File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11FROM python:3.13-alpine
22
3- ARG BUILD_DEV
3+ ARG BUILD_ENV
4+ ARG IMAGE_VERSION
5+
46ENV TZ="Asia/Shanghai"
57ENV UID=1000
68ENV GID=1000
@@ -9,7 +11,7 @@ ENV WEBDAV_PORT="8000"
911ENV WEBDAV_CONFIGFILE="/data/webdav.toml"
1012ENV WEBDAV_LOGGING_LEVEL="INFO"
1113
12- RUN if [ "$BUILD_DEV " = "rex" ]; then echo "Change depends" \
14+ RUN if [ "$BUILD_ENV " = "rex" ]; then echo "Change depends" \
1315 && pip config set global.index-url https://proxpi.h.rexzhang.com/index/ \
1416 && pip config set install.trusted-host proxpi.h.rexzhang.com \
1517 && sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
@@ -56,6 +58,7 @@ EXPOSE 8000
5658CMD [ "/app/entrypoint.sh" ]
5759
5860LABEL org.opencontainers.image.title="ASGI WebDAV Server"
61+ LABEL org.opencontainers.image.version="$IMAGE_VERSION"
5962LABEL org.opencontainers.image.authors="Rex Zhang"
60- LABEL org.opencontainers.image.url="https://hub.docker.com/repository/docker/ray1ex/asgi-webdav"
63+ # LABEL org.opencontainers.image.url="https://hub.docker.com/repository/docker/ray1ex/asgi-webdav"
6164LABEL org.opencontainers.image.source="https://github.com/rexzhang/asgi-webdav"
Original file line number Diff line number Diff line change 44from invoke .context import Context
55
66_DOCKER_PULL = "docker pull --platform=linux/amd64"
7- _DOCKER_BUILD = "docker buildx build --platform=linux/amd64 --build-arg BUILD_DEV =rex"
7+ _DOCKER_BUILD = "docker buildx build --platform=linux/amd64 --build-arg BUILD_ENV =rex" # TODO: t-string
88_DOCKER_RUN = "docker run --platform=linux/amd64"
99_c = Context ()
1010
@@ -104,7 +104,11 @@ def env_localhost(c):
104104
105105def docker_build (c ):
106106 print ("build docker image..." )
107- c .run (f"{ _DOCKER_BUILD } -t { ev .DOCKER_IMAGE_FULL_NAME } ." )
107+ from asgi_webdav import __version__
108+
109+ c .run (
110+ f"{ _DOCKER_BUILD } --build-arg IMAGE_VERSION={ __version__ } -t { ev .DOCKER_IMAGE_FULL_NAME } ."
111+ )
108112
109113 say_it ("docker image build finished" )
110114
You can’t perform that action at this time.
0 commit comments