This commit is contained in:
Administrator
2022-11-07 08:25:05 +03:00
parent 7a14bf83c6
commit 323dfd59aa
5 changed files with 34 additions and 36 deletions

17
docker-cleaner/Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM ubuntu:20.04
RUN apt-get update
RUN apt-get install --yes ca-certificates curl gnupg lsb-release
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update --yes
RUN apt-get install --yes docker-ce docker-ce-cli containerd.io docker-compose-plugin
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
COPY clean.sh clean.sh
RUN chmod 777 clean.sh
CMD ["./clean.sh"]

5
docker-cleaner/clean.sh Normal file
View File

@@ -0,0 +1,5 @@
while true
do
docker image rm $(docker image ls -q) || true
sleep(86400)
done