mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-10-16 04:21:56 +00:00
PR #2314 turned /var into a tmpfs (possibly overmounted by a persistent disk) and made /var/run into a symlink to /run. Adjust various containers and bind mount settings to allow for this change. In particular ensuring that everything can find the correct shared /var/run/docker.sock, which due to the symlink is now actually at /run. Signed-off-by: Ian Campbell <ijc@docker.com>
25 lines
803 B
Docker
25 lines
803 B
Docker
FROM docker:17.06.0-ce AS docker
|
|
|
|
# Nothing to do in here, just for COPY --from=docker below
|
|
|
|
FROM linuxkit/alpine:9bcf61f605ef0ce36cc94d59b8eac307862de6e1 AS build
|
|
|
|
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
|
|
RUN apk add --no-cache --initdb -p /out \
|
|
alpine-baselayout \
|
|
busybox
|
|
|
|
# Remove apk residuals. We have a read-only rootfs, so apk is of no use.
|
|
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
|
|
|
|
RUN rmdir /out/var/run && ln -nfs /run /out/var/run
|
|
|
|
FROM scratch
|
|
WORKDIR /
|
|
COPY --from=build /out /
|
|
COPY --from=docker /usr/local/bin/docker /usr/local/bin/docker
|
|
COPY *.tar /images/
|
|
ENTRYPOINT [ "/bin/sh", "-c" ]
|
|
CMD [ "for image in /images/*.tar ; do docker image load -i $image && rm -f $image ; done" ]
|
|
LABEL org.mobyproject.config='{"binds": ["/var/run:/var/run"]}'
|