winloong
3 years ago
3 changed files with 48 additions and 22 deletions
@ -1,22 +1,26 @@ |
|||
FROM docker:20-dind-rootless |
|||
|
|||
USER root |
|||
|
|||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ |
|||
&& apk add --no-cache python3 py3-pip shadow \ |
|||
&& apk add --no-cache python3 py3-pip shadow su-exec \ |
|||
&& ln -sf python3 /usr/bin/python \ |
|||
&& python3 -m ensurepip \ |
|||
&& pip3 install --no-cache --upgrade pip setuptools -i https://pypi.tuna.tsinghua.edu.cn/simple \ |
|||
&& pip install --no-cache kubernetes requests docker -i https://pypi.tuna.tsinghua.edu.cn/simple \ |
|||
&& rm -rf /var/cache/apk/* \ |
|||
&& usermod -aG ping rootless \ |
|||
&& echo "#!/bin/sh \n\ |
|||
python syncimages.py " >> /etc/periodic/daily/sync-images \ |
|||
&& chmod +x /etc/periodic/daily/sync-images |
|||
&& echo $'#!/bin/sh \n\ |
|||
python /app/syncimages.py' >> /etc/periodic/daily/sync-images \ |
|||
&& chmod +x /etc/periodic/daily/sync-images \ |
|||
&& apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
|||
&& echo "Asia/Shanghai" > /etc/timezone \ |
|||
&& apk del tzdata shadow \ |
|||
&& rm -rf /var/cache/apk/* |
|||
|
|||
WORKDIR /app |
|||
|
|||
COPY . . |
|||
|
|||
RUN chown -R rootless:rootless /app |
|||
RUN chown -R rootless /app |
|||
|
|||
USER rootless |
|||
ENTRYPOINT ["./entrypoint.sh"] |
|||
|
@ -0,0 +1,4 @@ |
|||
#!/bin/sh |
|||
crond; |
|||
su rootless -c 'dockerd-entrypoint.sh' |
|||
|
Reference in new issue