diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dedd23b..a7a9c5a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: if: github.ref == 'refs/heads/master' run: | docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }} - docker image push dockcross/base + docker image push dockcross/base --all-tags image: name: ${{ matrix.arch_name }} @@ -58,6 +58,4 @@ jobs: if: github.ref == 'refs/heads/master' run: | docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }} - docker image push dockcross/${{ matrix.arch_name }}:latest - tagged_image=$(docker images --filter 'reference=dockcross/${{ matrix.arch_name }}:20*' --format "{{.Repository}}:{{.Tag}}" | head -n1) - docker image push ${tagged_image} + docker image push dockcross/${{ matrix.arch_name }} --all-tags diff --git a/Makefile b/Makefile index 5b7cc02..744c249 100644 --- a/Makefile +++ b/Makefile @@ -79,18 +79,12 @@ web-wasm: web-wasm/Dockerfile mkdir -p $@/imagefiles && cp -r imagefiles $@/ cp -r test web-wasm/ $(DOCKER) build -t $(ORG)/web-wasm:latest \ + -t $(ORG)/web-wasm:$(TAG) \ --build-arg IMAGE=$(ORG)/web-wasm \ --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"` \ web-wasm - $(DOCKER) build -t $(ORG)/web-wasm:$(TAG) \ - --build-arg IMAGE=$(ORG)/web-wasm \ - --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"` \ - web-wasm rm -rf web-wasm/test rm -rf $@/imagefiles @@ -106,18 +100,12 @@ web-wasm.test: web-wasm manylinux2014-aarch64: manylinux2014-aarch64/Dockerfile mkdir -p $@/imagefiles && cp -r imagefiles $@/ $(DOCKER) build -t $(ORG)/manylinux2014-aarch64:latest \ + -t $(ORG)/manylinux2014-aarch64:$(TAG) \ --build-arg IMAGE=$(ORG)/manylinux2014-aarch64 \ --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"` \ -f manylinux2014-aarch64/Dockerfile . - $(DOCKER) build -t $(ORG)/manylinux2014-aarch64:$(TAG) \ - --build-arg IMAGE=$(ORG)/manylinux2014-aarch64 \ - --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"` \ - -f manylinux2014-aarch64/Dockerfile . rm -rf $@/imagefiles manylinux2014-aarch64.test: manylinux2014-aarch64 @@ -130,18 +118,12 @@ manylinux2014-aarch64.test: manylinux2014-aarch64 manylinux2014-x64: manylinux2014-x64/Dockerfile mkdir -p $@/imagefiles && cp -r imagefiles $@/ $(DOCKER) build -t $(ORG)/manylinux2014-x64:latest \ + -t $(ORG)/manylinux2014-x64:$(TAG) \ --build-arg IMAGE=$(ORG)/manylinux2014-x64 \ --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"` \ -f manylinux2014-x64/Dockerfile . - $(DOCKER) build -t $(ORG)/manylinux2014-x64:$(TAG) \ - --build-arg IMAGE=$(ORG)/manylinux2014-x64 \ - --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"` \ - -f manylinux2014-x64/Dockerfile . rm -rf $@/imagefiles manylinux2014-x64.test: manylinux2014-x64 @@ -154,18 +136,12 @@ manylinux2014-x64.test: manylinux2014-x64 manylinux2014-x86: manylinux2014-x86/Dockerfile mkdir -p $@/imagefiles && cp -r imagefiles $@/ $(DOCKER) build -t $(ORG)/manylinux2014-x86:latest \ + -t $(ORG)/manylinux2014-x86:$(TAG) \ --build-arg IMAGE=$(ORG)/manylinux2014-x86 \ --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"` \ -f manylinux2014-x86/Dockerfile . - $(DOCKER) build -t $(ORG)/manylinux2014-x86:$(TAG) \ - --build-arg IMAGE=$(ORG)/manylinux2014-x86 \ - --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"` \ - -f manylinux2014-x86/Dockerfile . rm -rf $@/imagefiles manylinux2014-x86.test: manylinux2014-x86 @@ -179,18 +155,12 @@ manylinux2014-x86.test: manylinux2014-x86 manylinux2010-x64: manylinux2010-x64/Dockerfile mkdir -p $@/imagefiles && cp -r imagefiles $@/ $(DOCKER) build -t $(ORG)/manylinux2010-x64:latest \ + -t $(ORG)/manylinux2010-x64:$(TAG) \ --build-arg IMAGE=$(ORG)/manylinux2010-x64 \ --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"` \ -f manylinux2010-x64/Dockerfile . - $(DOCKER) build -t $(ORG)/manylinux2010-x64:$(TAG) \ - --build-arg IMAGE=$(ORG)/manylinux2010-x64 \ - --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"` \ - -f manylinux2010-x64/Dockerfile . rm -rf $@/imagefiles manylinux2010-x64.test: manylinux2010-x64 @@ -204,18 +174,12 @@ manylinux2010-x64.test: manylinux2010-x64 manylinux2010-x86: manylinux2010-x86/Dockerfile mkdir -p $@/imagefiles && cp -r imagefiles $@/ $(DOCKER) build -t $(ORG)/manylinux2010-x86:latest \ + -t $(ORG)/manylinux2010-x86:$(TAG) \ --build-arg IMAGE=$(ORG)/manylinux2010-x86 \ --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"` \ -f manylinux2010-x86/Dockerfile . - $(DOCKER) build -t $(ORG)/manylinux2010-x86:$(TAG) \ - --build-arg IMAGE=$(ORG)/manylinux2010-x86 \ - --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"` \ - -f manylinux2010-x86/Dockerfile . rm -rf $@/imagefiles manylinux2010-x86.test: manylinux2010-x86 @@ -229,18 +193,12 @@ manylinux2010-x86.test: manylinux2010-x86 manylinux1-x64: manylinux1-x64/Dockerfile mkdir -p $@/imagefiles && cp -r imagefiles $@/ $(DOCKER) build -t $(ORG)/manylinux1-x64:latest \ + -t $(ORG)/manylinux1-x64:$(TAG) \ --build-arg IMAGE=$(ORG)/manylinux1-x64 \ --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"` \ -f manylinux1-x64/Dockerfile . - $(DOCKER) build -t $(ORG)/manylinux1-x64:$(TAG) \ - --build-arg IMAGE=$(ORG)/manylinux1-x64 \ - --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"` \ - -f manylinux1-x64/Dockerfile . rm -rf $@/imagefiles manylinux1-x64.test: manylinux1-x64 @@ -254,18 +212,12 @@ manylinux1-x64.test: manylinux1-x64 manylinux1-x86: manylinux1-x86/Dockerfile mkdir -p $@/imagefiles && cp -r imagefiles $@/ $(DOCKER) build -t $(ORG)/manylinux1-x86:latest \ + -t $(ORG)/manylinux1-x86:$(TAG) \ --build-arg IMAGE=$(ORG)/manylinux1-x86 \ --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"` \ -f manylinux1-x86/Dockerfile . - $(DOCKER) build -t $(ORG)/manylinux1-x86:$(TAG) \ - --build-arg IMAGE=$(ORG)/manylinux1-x86 \ - --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"` \ - -f manylinux1-x86/Dockerfile . rm -rf $@/imagefiles manylinux1-x86.test: manylinux1-x86 @@ -278,14 +230,10 @@ manylinux1-x86.test: manylinux1-x86 base: Dockerfile imagefiles/ $(DOCKER) build -t $(ORG)/base:latest \ + -t $(ORG)/base:$(TAG) \ --build-arg IMAGE=$(ORG)/base \ --build-arg VCS_URL=`git config --get remote.origin.url` \ . - $(DOCKER) build -t $(ORG)/base:$(TAG) \ - --build-arg IMAGE=$(ORG)/base \ - --build-arg VERSION=$(TAG) \ - --build-arg VCS_URL=`git config --get remote.origin.url` \ - . base.test: base $(DOCKER) run $(RM) $(ORG)/base > $(BIN)/dockcross-base && chmod +x $(BIN)/dockcross-base @@ -305,18 +253,12 @@ $(VERBOSE).SILENT: display_images $(STANDARD_IMAGES): %: %/Dockerfile base mkdir -p $@/imagefiles && cp -r imagefiles $@/ $(DOCKER) build -t $(ORG)/$@:latest \ + -t $(ORG)/$@:$(TAG) \ --build-arg IMAGE=$(ORG)/$@ \ --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"` \ $@ - $(DOCKER) build -t $(ORG)/$@:$(TAG) \ - --build-arg IMAGE=$(ORG)/$@ \ - --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"` \ - $@ rm -rf $@/imagefiles clean: @@ -324,6 +266,12 @@ clean: for d in $(GEN_IMAGE_DOCKERFILES) ; do rm -f $$d/Dockerfile ; done rm -f Dockerfile +purge: clean +# Remove all untagged images + $(DOCKER) container ls -aq | xargs --no-run-if-empty $(DOCKER) container rm -f +# Remove all images with organization (ex dockcross/*) + $(DOCKER) images --filter=reference='$(ORG)/*' --format='{{.Repository}}:{{.Tag}}' | xargs -r $(DOCKER) rmi -f + # # testing implicit rule #