docker-gc/Dockerfile
2017-12-07 10:52:39 +00:00

36 lines
812 B
Docker
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM scratch
ADD rootfs.tar.xz /
# environment variables
ENV FORCE_CONTAINER_REMOVAL=1 \
FORCE_IMAGE_REMOVAL=1
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
git && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
bash \
docker && \
echo "**** fetch latest ver of docker-gc script ****" && \
git clone https://github.com/spotify/docker-gc /tmp/docker-gc && \
echo "**** link docker executable, copy and make docker-gc executable ****" && \
ln -s /usr/bin/docker \
/bin/docker && \
cp /tmp/docker-gc/docker-gc /docker-gc && \
chmod +x \
/docker-gc && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/*
# volumes
VOLUME /var/lib/docker-gc
# run command
CMD ["/docker-gc"]