Skip to content

Commit

Permalink
Add revision information to docker images (benetech#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan-anokhin committed Nov 16, 2020
1 parent 7e4e486 commit d6b82a4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ services:
build:
context: .
dockerfile: "docker/Dockerfile.dedup-${BENETECH_RUNTIME:-gpu}"
args:
GIT_HASH: "${GIT_HASH}"
runtime: "${BENETECH_DOCKER_RUNTIME:-nvidia}"
command: bash -ic "bash serve_jupyter.sh"
environment:
Expand All @@ -55,6 +57,8 @@ services:
build:
context: .
dockerfile: docker/Dockerfile.server
args:
GIT_HASH: "${GIT_HASH}"
environment:
SERVER_HOST: "0.0.0.0"
SERVER_PORT: "5000"
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.dedup-cpu
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ RUN apt update
RUN apt-get install -y libsm6 libxext6 libxrender-dev nano libgl1-mesa-glx mediainfo

RUN /bin/bash -c "source activate winnow && bash scripts/run-tests.sh"

ARG GIT_HASH=unspecified
LABEL git_hash=$GIT_HASH
3 changes: 3 additions & 0 deletions docker/Dockerfile.dedup-gpu
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ RUN /bin/bash -c "source activate winnow && \
RUN apt update

RUN apt-get install -y libsm6 libxext6 libxrender-dev nano libgl1-mesa-glx mediainfo

ARG GIT_HASH=unspecified
LABEL git_hash=$GIT_HASH
2 changes: 2 additions & 0 deletions docker/Dockerfile.server
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ RUN pip install -r requirements.txt

COPY --from=web /web/build /server/static

ARG GIT_HASH=unspecified
LABEL git_hash=$GIT_HASH
CMD python -m server.main
6 changes: 3 additions & 3 deletions scripts/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ fi
if [ "$BENETECH_MODE" = "-dev" ]; then
set -x
sudo docker-compose rm -s -f
sudo docker-compose build --parallel --no-cache
sudo docker-compose build --build-arg GIT_HASH="$(git rev-parse --short HEAD)" --parallel --no-cache
else
set -x
sudo docker build --no-cache -t "johnhbenetech/videodeduplication:${BENETECH_RUNTIME:-gpu}-dev" . -f "docker/Dockerfile.dedup-${BENETECH_RUNTIME:-gpu}"
sudo docker build --no-cache -t "johnhbenetech/videodeduplication:server-dev" . -f "docker/Dockerfile.server"
sudo docker build --build-arg GIT_HASH="$(git rev-parse --short HEAD)" --no-cache -t "johnhbenetech/videodeduplication:${BENETECH_RUNTIME:-gpu}-dev" . -f "docker/Dockerfile.dedup-${BENETECH_RUNTIME:-gpu}"
sudo docker build --build-arg GIT_HASH="$(git rev-parse --short HEAD)" --no-cache -t "johnhbenetech/videodeduplication:server-dev" . -f "docker/Dockerfile.server"
fi

0 comments on commit d6b82a4

Please sign in to comment.