diff --git a/.circleci/config.yml b/.circleci/config.yml index 46407a6..b8b04c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,7 +73,8 @@ jobs: command: | docker load -i ~/docker/base.tar make browser-asmjs - docker save -o ~/docker/browser-asmjs.tar dockcross/browser-asmjs:latest + tagged=$(docker images -q -f 'since=dockcross/browser-asmjs:latest' --format '{{.Repository}}:{{.Tag}}') + docker save -o ~/docker/browser-asmjs.tar dockcross/browser-asmjs:latest $tagged - run: name: browser-asmjs test command: | @@ -399,10 +400,9 @@ jobs: docker load -i ~/docker/browser-asmjs.tar if [ "${CIRCLE_BRANCH}" == "master" ]; then docker login -u $DOCKER_USER -p $DOCKER_PASS - TAG=$(date '+%Y%m%d')-$(git rev-parse --short HEAD) docker push dockcross/browser-asmjs:latest - docker tag dockcross/browser-asmjs:latest dockcross/browser-asmjs:${TAG} - docker push dockcross/browser-asmjs:${TAG} + tagged=$(docker images -q -f 'since=dockcross/browser-asmjs:latest' --format '{{.Repository}}:{{.Tag}}') + docker push $tagged fi - restore_cache: key: linux-arm64-assets-{{ .Revision }} diff --git a/Makefile b/Makefile index 6f281cc..e738fdb 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,13 @@ browser-asmjs: browser-asmjs/Dockerfile --build-arg VCS_URL=`git config --get remote.origin.url` \ --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ browser-asmjs - $(DOCKER) tag $(ORG)/browser-asmjs:latest $(ORG)/browser-asmjs:$(TAG) + $(DOCKER) build -t $(ORG)/browser-asmjs:$(TAG) \ + --build-arg IMAGE=$(ORG)/browser-asmjs \ + --build-arg VERSION=$(TAG) \ + --build-arg VCS_REF=`git rev-parse --short HEAD` \ + --build-arg VCS_URL=`git config --get remote.origin.url` \ + --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + browser-asmjs rm -rf browser-asmjs/test rm -rf $@/imagefiles diff --git a/browser-asmjs/Dockerfile.in b/browser-asmjs/Dockerfile.in index acc9ec7..58b925d 100644 --- a/browser-asmjs/Dockerfile.in +++ b/browser-asmjs/Dockerfile.in @@ -16,17 +16,19 @@ ENV CC=/emsdk_portable/sdk/emcc \ CXX=/emsdk_portable/sdk/em++ \ AR=/emsdk_portable/sdk/emar -ENV DEFAULT_DOCKCROSS_IMAGE dockcross/browser-asmjs ENV CMAKE_TOOLCHAIN_FILE /emsdk_portable/sdk/cmake/Modules/Platform/Emscripten.cmake # Build-time metadata as defined at http://label-schema.org ARG BUILD_DATE -ARG IMAGE +ARG IMAGE=dockcross/browser-asmjs +ARG VERSION=latest ARG VCS_REF ARG VCS_URL LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.name=$IMAGE \ + org.label-schema.version=$VERSION \ org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.vcs-url=$VCS_URL \ org.label-schema.schema-version="1.0" +ENV DEFAULT_DOCKCROSS_IMAGE ${IMAGE}:${VERSION}