File: env_build.sh

package info (click to toggle)
refstack-client 0.0.0~2023.09.19.b60a7e41f7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 592 kB
  • sloc: python: 1,998; sh: 220; makefile: 25
file content (21 lines) | stat: -rwxr-xr-x 589 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash -x

if [ "$EUID" -eq 0 ]
  then echo "This script should not be runned with sudo!"
  exit
fi

docker ps &> /dev/null; (( $? != 0 )) && echo 'Docker should be accessible without sudo '


CONTAINER_NAME=refstack_client

if [ $( docker ps -a -q --filter name=${CONTAINER_NAME} ) ]; then
    docker rm -f $( docker ps -a -q --filter name=${CONTAINER_NAME} )
fi

docker build -t ${CONTAINER_NAME} \
    --build-arg UID=$( id -u $USER ) \
    --build-arg GID=$( id -g $USER ) \
    --file $( git rev-parse --show-toplevel )/docker/Dockerfile \
    $( git rev-parse --show-toplevel )