Browse Source

Try docker commit again

Rob Austein 6 years ago
parent
commit
bb2f109831
1 changed files with 10 additions and 9 deletions
  1. 10 9
      Makefile

+ 10 - 9
Makefile

@@ -1,19 +1,19 @@
 XILINX_TARBALL		:= Xilinx_ISE_DS_Lin_14.7_1015_1.tar
 XILINX_LICENSE		:= Xilinx.lic
+XILINX_PKGDIR		:= fs/$(basename ${XILINX_TARBALL})
+
 BOOTSTRAP_IMAGE		:= cryptech-builder:bootstrap
 BOOTSTRAP_CONTAINER	:= cryptech-builder-bootstrap
-CRYPTECH_BASE_FILE	:= cryptech-builder-base-image.xz
-XILINX_PKGDIR		:= fs/$(basename ${XILINX_TARBALL})
+BASE_IMAGE		:= cryptech-builder:base
 
 ifneq (./,$(sort $(dir ${XILINX_TARBALL} ${XILINX_LICENSE})))
 $(error XILINX_TARBALL and XILINX_LICENSE must be in this directory for bind mount)
 endif
 
-all: ${CRYPTECH_BASE_FILE}
-	docker import ${CRYPTECH_BASE_FILE} cryptech-builder:base
-	docker build -t cryptech-builder .
+# all: $(if $(shell docker image ls -q ${NAME}:${VERS}),,Dockerfile ${DEB})
 
-${CRYPTECH_BASE_FILE}: ${XILINX_TARBALL} ${XILINX_LICENSE} Builder Ratinox
+all:
+ifeq (,$(shell docker image ls -q ${BASE_IMAGE}))
 	-docker container rm -f ${BOOTSTRAP_CONTAINER}
 	-docker image     rm -f ${BOOTSTRAP_IMAGE}
 	rm -rf fs
@@ -32,12 +32,13 @@ ${CRYPTECH_BASE_FILE}: ${XILINX_TARBALL} ${XILINX_LICENSE} Builder Ratinox
 		/cryptech-builder/Builder
 	rm -rf fs
 	-mogrify -verbose -format png *.xwd && rm *.xwd
-	docker export ${BOOTSTRAP_CONTAINER} | xz -v >${CRYPTECH_BASE_FILE}.tmp
+	docker ${BOOTSTRAP_CONTAINER} ${BASE_IMAGE}
 	docker container rm -f ${BOOTSTRAP_CONTAINER}
-	docker image     rm -f ${BOOTSTRAP_IMAGE}
-	mv ${CRYPTECH_BASE_FILE}.tmp ${CRYPTECH_BASE_FILE}
+endif
+	docker build -t cryptech-builder .
 
 clean:
 	git clean -dfx -e ${XILINX_TARBALL} -e ${XILINX_LICENSE}
+	-docker container rm -f ${BOOTSTRAP_CONTAINER}
 
 .PHONY: all clean