mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 18:11:35 +00:00
Move mount back to its own package, not inside docker
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
48cb54d378
commit
3ffa912c41
@ -38,7 +38,5 @@ RUN set -x \
|
|||||||
&& rm docker.tgz \
|
&& rm docker.tgz \
|
||||||
&& docker -v
|
&& docker -v
|
||||||
|
|
||||||
COPY . ./
|
|
||||||
|
|
||||||
# use the Docker copy of tini as our init for zombie reaping
|
# use the Docker copy of tini as our init for zombie reaping
|
||||||
ENTRYPOINT ["/usr/bin/docker-init", "/bin/sh", "/docker.sh"]
|
ENTRYPOINT ["/usr/bin/docker-init", "/usr/bin/dockerd"]
|
||||||
|
@ -5,7 +5,7 @@ IMAGE=docker-ce
|
|||||||
|
|
||||||
default: push
|
default: push
|
||||||
|
|
||||||
hash: Dockerfile docker.sh
|
hash: Dockerfile
|
||||||
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
||||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
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/ .*//' > $@
|
docker run --entrypoint /bin/sh --rm $(IMAGE):build -c 'cat $^ /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > $@
|
||||||
|
11
pkg/mount/Dockerfile
Normal file
11
pkg/mount/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
FROM alpine:3.5
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
apk update && apk upgrade -a && \
|
||||||
|
apk add --no-cache \
|
||||||
|
jq \
|
||||||
|
sfdisk \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
COPY . ./
|
||||||
|
CMD ["/bin/sh", "/mount.sh"]
|
29
pkg/mount/Makefile
Normal file
29
pkg/mount/Makefile
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
.PHONY: tag push
|
||||||
|
|
||||||
|
BASE=alpine:3.5
|
||||||
|
IMAGE=mount
|
||||||
|
|
||||||
|
default: push
|
||||||
|
|
||||||
|
hash: Dockerfile mount.sh
|
||||||
|
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
||||||
|
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||||
|
docker run --rm --entrypoint /bin/sh $(IMAGE):build -c "cat $^ /lib/apk/db/installed | sha1sum" | sed 's/ .*//' > $@
|
||||||
|
|
||||||
|
push: hash
|
||||||
|
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||||
|
(docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
|
||||||
|
docker push mobylinux/$(IMAGE):$(shell cat hash))
|
||||||
|
docker rmi $(IMAGE):build
|
||||||
|
rm -f hash
|
||||||
|
|
||||||
|
tag: hash
|
||||||
|
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||||
|
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)
|
||||||
|
docker rmi $(IMAGE):build
|
||||||
|
rm -f hash
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f hash
|
||||||
|
|
||||||
|
.DELETE_ON_ERROR:
|
@ -2,12 +2,14 @@
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
MOUNTPOINT="$1"
|
||||||
|
|
||||||
|
[ -z "$MOUNTPOINT" ] && echo "No mountpoint specified" && exit 1
|
||||||
|
|
||||||
|
mkdir -p "$MOUNTPOINT"
|
||||||
|
|
||||||
mount_drive()
|
mount_drive()
|
||||||
{
|
{
|
||||||
MOUNTPOINT=/var/lib/docker
|
|
||||||
|
|
||||||
mkdir -p "$MOUNTPOINT"
|
|
||||||
|
|
||||||
# TODO fix for multiple disks, cdroms etc
|
# TODO fix for multiple disks, cdroms etc
|
||||||
DEVS="$(find /dev -maxdepth 1 -type b ! -name 'loop*' ! -name 'nbd*' | grep -v '[0-9]$' | sed 's@.*/dev/@@' | sort)"
|
DEVS="$(find /dev -maxdepth 1 -type b ! -name 'loop*' ! -name 'nbd*' | grep -v '[0-9]$' | sed 's@.*/dev/@@' | sort)"
|
||||||
|
|
||||||
@ -28,11 +30,6 @@ mount_drive()
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo "WARNING: Failed to mount a persistent volume (is there one?)"
|
echo "WARNING: Failed to mount a persistent volume (is there one?)"
|
||||||
|
|
||||||
# not sure if we want to fatally bail here, in some debug situations it is ok
|
|
||||||
# exit 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mount_drive
|
mount_drive
|
||||||
|
|
||||||
exec /usr/bin/dockerd
|
|
Loading…
Reference in New Issue
Block a user