Browse Source

Add "base:" target.

Rob Austein 5 years ago
parent
commit
e6fce11310
2 changed files with 14 additions and 4 deletions
  1. 4 2
      Dockerfile
  2. 10 2
      Makefile

+ 4 - 2
Dockerfile

@@ -1,8 +1,10 @@
 # Given that this is security software, you might want to consider
 # generating your own debian:stretch base image using debbootstrap
-# rather than trusting Dockerhub
+# rather than trusting Dockerhub, see "base" target in the Makefile.
 
-FROM debian:stretch
+ARG  DIST=debian
+ARG  CODE=stretch
+FROM $DIST:$CODE
 
 # Prerequisites.  Current version of python-django is a bit too recent
 # for the rpki-ca GUI, but rpki-rp only uses the ORM, which hasn't

+ 10 - 2
Makefile

@@ -1,8 +1,16 @@
+DIST := debian
+CODE := stretch
+
 all:
 	apt-get download rpki-rp
-	docker build -t rpki-rp .
+	docker build --tag rpki-rp --build-arg 'DIST=${DIST}' --build-arg 'CODE=${CODE}' .
 
 clean:
 	git clean -dfx
 
-.PHONY: all clean
+base:
+	sudo debootstrap ${CODE} ${CODE}
+	sudo tar -C ${CODE} -c . | docker import - ${DIST}:${CODE}
+	sudo rm -rf ${CODE}
+
+.PHONY: all clean base