From fa90764b5533365bbecad8d84e5530fcf3eaf5ee Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Wed, 3 May 2017 14:27:05 +0100 Subject: [PATCH] Remove unused mkimage-base We have not used this for ages, we use Go code in `moby` tool to do this now. Signed-off-by: Justin Cormack --- tools/mkimage-base/Dockerfile | 12 --------- tools/mkimage-base/Makefile | 29 ---------------------- tools/mkimage-base/mkimage.sh | 46 ----------------------------------- 3 files changed, 87 deletions(-) delete mode 100644 tools/mkimage-base/Dockerfile delete mode 100644 tools/mkimage-base/Makefile delete mode 100755 tools/mkimage-base/mkimage.sh diff --git a/tools/mkimage-base/Dockerfile b/tools/mkimage-base/Dockerfile deleted file mode 100644 index ebad7c9c4..000000000 --- a/tools/mkimage-base/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM alpine:3.5 - -RUN \ - apk update && apk upgrade && \ - apk add \ - docker \ - tar \ - && true - -COPY . . - -ENTRYPOINT ["/mkimage.sh"] diff --git a/tools/mkimage-base/Makefile b/tools/mkimage-base/Makefile deleted file mode 100644 index 08056661f..000000000 --- a/tools/mkimage-base/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -.PHONY: tag push - -BASE=alpine:3.5 -IMAGE=mkimage-base - -default: push - -hash: Dockerfile mkimage.sh - DOCKER_CONTENT_TRUST=1 docker pull $(BASE) - tar cf - $^ | docker build --no-cache -t $(IMAGE):build - - docker run --entrypoint=/bin/sh --rm $(IMAGE):build -c "cat $^ /lib/apk/db/installed | sha1sum" | sed 's/ .*//' > $@ - -push: hash - docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ - (docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \ - docker push linuxkit/$(IMAGE):$(shell cat hash)) - docker rmi $(IMAGE):build - rm -f hash - -tag: hash - docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ - docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) - docker rmi $(IMAGE):build - rm -f hash - -clean: - rm -f hash - -.DELETE_ON_ERROR: diff --git a/tools/mkimage-base/mkimage.sh b/tools/mkimage-base/mkimage.sh deleted file mode 100755 index fcb0cfae5..000000000 --- a/tools/mkimage-base/mkimage.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -set -e - -# arguments are image name -# This script will output a tarball, suitable to be turned into a cpio archive -# This is a bit hacky, should be improved later, as it hardcodes config. - -IMAGE="$1"; shift - -cd /tmp - -# extract rootfs -EXCLUDE="--exclude .dockerenv --exclude Dockerfile \ - --exclude dev/console --exclude dev/pts --exclude dev/shm \ - --exclude etc/hostname --exclude etc/hosts --exclude etc/mtab --exclude etc/resolv.conf" - -CONTAINER="$(docker create $IMAGE /dev/null)" -docker export "$CONTAINER" | tar -xf - $EXCLUDE -docker rm "$CONTAINER" > /dev/null - -# these three files are bind mounted in by docker so they are not what we want - -mkdir -p etc - -cat << EOF > etc/hosts -127.0.0.1 localhost -::1 localhost ip6-localhost ip6-loopback -fe00::0 ip6-localnet -ff00::0 ip6-mcastprefix -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -EOF - -cat << EOF > etc/resolv.conf -nameserver 8.8.8.8 -nameserver 8.8.4.4 -nameserver 2001:4860:4860::8888 -nameserver 2001:4860:4860::8844 -EOF - -printf '(none)' > etc/hostname - -ln -s /proc/mounts etc/mtab - -tar cf - .