forked from chadoe/docker-cleanup-volumes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
24 lines (19 loc) · 767 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
#Cleanup orphaned docker volumes
#Usage:
#docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes [--dry-run]
#
FROM alpine:3.2
MAINTAINER Martin van Beurden <[email protected]>
ENV DOCKER_VERSION=1.4.1
#Install an up to date version of docker
RUN apk add --update-cache curl bash grep && \
# the docker package in alpine disables aufs and devicemapper
curl -sSL https://get.docker.com/builds/Linux/x86_64/docker-$DOCKER_VERSION -o /usr/bin/docker && \
chmod +x /usr/bin/docker && \
#cleanup
apk del curl && rm -rf /var/cache/apk/*
#Add the cleanup script
ADD ./docker-cleanup-volumes.sh /usr/local/bin/
#Define entrypoint
ENTRYPOINT ["/usr/local/bin/docker-cleanup-volumes.sh"]