Skip to content

Commit 82cd28d

Browse files
authored
include repo2docker version in docker tags (#777)
include repo2docker version in docker tags
2 parents b20eb6a + 3cc3aa4 commit 82cd28d

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ RUN apk add --no-cache git python3 python3-dev
55

66
# build wheels in first image
77
ADD . /tmp/src
8+
RUN cd /tmp/src && git clean -xfd && git status
89
RUN mkdir /tmp/wheelhouse \
910
&& cd /tmp/wheelhouse \
1011
&& pip3 install wheel \
11-
&& pip3 wheel --no-cache-dir /tmp/src
12+
&& pip3 wheel --no-cache-dir /tmp/src \
13+
&& ls -l /tmp/wheelhouse
1214

1315
FROM alpine:${ALPINE_VERSION}
1416

@@ -17,7 +19,8 @@ RUN apk add --no-cache git git-lfs python3 bash
1719

1820
# install repo2docker
1921
COPY --from=0 /tmp/wheelhouse /tmp/wheelhouse
20-
RUN pip3 install --no-cache-dir /tmp/wheelhouse/*.whl
22+
RUN pip3 install --no-cache-dir /tmp/wheelhouse/*.whl \
23+
&& pip3 list
2124

2225
# add git-credential helper
2326
COPY ./docker/git-credential-env /usr/local/bin/git-credential-env

hooks/post_push

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/bash
22

3-
# when building jupyter/repo2docker:master also push jupyter/repo2docker:abcd1234
4-
5-
HASH_IMAGE="$DOCKER_REPO:${SOURCE_COMMIT:0:8}"
6-
docker tag $DOCKER_REPO:$DOCKER_TAG $HASH_IMAGE
7-
docker push $HASH_IMAGE
3+
# when building jupyter/repo2docker:master
4+
# also push jupyter/repo2docker:1.2.3-3.abcd1234 (replace + with -)
5+
version=$(docker run $DOCKER_REPO:$DOCKER_TAG jupyter-repo2docker --version | sed s@+@-@)
6+
VERSION_IMAGE="$DOCKER_REPO:$version"
7+
docker tag $DOCKER_REPO:$DOCKER_TAG "$VERSION_IMAGE"
8+
docker push "$VERSION_IMAGE"

0 commit comments

Comments
 (0)