From 3a723460e532d74e2ed03647e53ff39888d48fb7 Mon Sep 17 00:00:00 2001 From: Dedy Martadinata S Date: Wed, 13 Jul 2022 13:09:36 +0700 Subject: [PATCH] docker: Add volume support --- .github/workflows/Dockerfile.ci | 4 +++- .github/workflows/Dockerfile.ci.alpine | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Dockerfile.ci b/.github/workflows/Dockerfile.ci index 6bbb8c6..e7ab44b 100644 --- a/.github/workflows/Dockerfile.ci +++ b/.github/workflows/Dockerfile.ci @@ -59,9 +59,11 @@ RUN apt update && \ apt install -y --no-install-recommends tini ca-certificates gosu && \ apt clean && \ rm -rf /var/lib/apt/lists/* && \ - groupadd -g $GID $USER && useradd --system -m -g $USER --uid $UID $USER + groupadd -g $GID $USER && useradd --system -m -g $USER --uid $UID $USER && \ + mkdir -p /data && chown $USER:$USER /data COPY --from=lldap --chown=$CONTAINERUSER:$CONTAINERUSER /lldap /app COPY --from=lldap --chown=$CONTAINERUSER:$CONTAINERUSER /docker-entrypoint.sh /docker-entrypoint.sh +VOLUME ["/data"] WORKDIR /app ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"] CMD ["run", "--config-file", "/data/lldap_config.toml"] diff --git a/.github/workflows/Dockerfile.ci.alpine b/.github/workflows/Dockerfile.ci.alpine index 046cd5b..609eb77 100644 --- a/.github/workflows/Dockerfile.ci.alpine +++ b/.github/workflows/Dockerfile.ci.alpine @@ -66,9 +66,12 @@ RUN echo http://mirror.math.princeton.edu/pub/alpinelinux/edge/testing/ >> /etc/ --ingroup "$USER" \ --no-create-home \ --uid "$UID" \ - "$USER" + "$USER" && \ + mkdir -p /data && \ + chown $USER:$USER /data COPY --from=lldap --chown=$CONTAINERUSER:$CONTAINERUSER /lldap /app COPY --from=lldap --chown=$CONTAINERUSER:$CONTAINERUSER /docker-entrypoint.sh /docker-entrypoint.sh +VOLUME ["/data"] WORKDIR /app ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"] CMD ["run", "--config-file", "/data/lldap_config.toml"]