Skip to content

Commit

Permalink
fix permission issues (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
floryn90 authored Nov 16, 2024
2 parents fe8b1ce + b0606ab commit db2f7ea
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/docker/_imports/ci.df
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM main AS ci

ENV HUGO_ENV="production"
RUN chown -R hugo:hugo /src /target
USER hugo
ENTRYPOINT [ "" ]
CMD [ "hugo" ]
2 changes: 1 addition & 1 deletion src/docker/_imports/onbuild.df
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ONBUILD ENV HUGO_DESTINATION="${HUGO_DESTINATION_ARG:-/target}" \

ONBUILD COPY . /src
ONBUILD WORKDIR ${HUGO_DIR:-/src}

ONBUILD RUN chown -R hugoȘhugo /src /target
ONBUILD USER hugo

ONBUILD RUN if [ -e "$ONBUILD_SCRIPT_VALUE" ]; then exec sh $ONBUILD_SCRIPT_VALUE; else exec hugo $HUGO_CMD; fi
2 changes: 2 additions & 0 deletions src/docker/alpine-ext/ext-alpine.df
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ RUN true \
# add /src to safe.directory
&& git config --global --add safe.directory /src

VOLUME [ "/src", "/target" ]

EXPOSE 1313

WORKDIR /src
Expand Down
1 change: 1 addition & 0 deletions src/docker/alpine-ext/ext-asciidoctor.df
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN apk -U upgrade && apk --no-cache add asciidoctor \
&& chown -R hugo:hugo /src /target \
&& chmod -R a+rwx /src /target

VOLUME [ "/src", "/target" ]

IMPORT ../_imports/ci.df

Expand Down
2 changes: 2 additions & 0 deletions src/docker/alpine-ext/ext-pandoc.df
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ext-alpine AS main

VOLUME [ "/src", "/target" ]

COPY --from=base--pandoc / /

IMPORT ../_imports/default_nonroot_user_alpine.df
Expand Down
3 changes: 3 additions & 0 deletions src/docker/alpine/alpine.df
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ RUN apk -U upgrade && apk --no-cache add busybox-suid bash bash-completion tzdat
&& chown -R hugo:hugo /src /target \
&& chmod a+rwx /src /target

VOLUME [ "/src", "/target" ]


EXPOSE 1313
WORKDIR /src
ENTRYPOINT ["hugo"]
Expand Down
3 changes: 3 additions & 0 deletions src/docker/alpine/asciidoctor.df
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ RUN apk -U upgrade && apk --no-cache add asciidoctor \
&& gem install coderay asciidoctor-rouge --no-document \
&& find /tmp -mindepth 1 -maxdepth 1 | xargs rm -rf

VOLUME [ "/src", "/target" ]


IMPORT ../_imports/ci.df

IMPORT ../_imports/onbuild.df
Expand Down
2 changes: 2 additions & 0 deletions src/docker/alpine/pandoc.df
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ COPY --from=base--pandoc / /

IMPORT ../_imports/default_nonroot_user_alpine.df

VOLUME [ "/src", "/target" ]

IMPORT ../_imports/ci.df

IMPORT ../_imports/onbuild.df
Expand Down
2 changes: 2 additions & 0 deletions src/docker/busybox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ RUN mkdir -p /src /target \
&& chown -R hugo:hugo /src /target \
&& chmod a+wrx /src /target

VOLUME [ "/src", "/target" ]

EXPOSE 1313

WORKDIR /src
Expand Down
2 changes: 2 additions & 0 deletions src/docker/debian-ext/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ RUN true \

COPY --from=base--golang / /

VOLUME [ "/src", "/target" ]

IMPORT ../_imports/ci.df

IMPORT ../_imports/onbuild.df
Expand Down
2 changes: 2 additions & 0 deletions src/docker/debian/base.df
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ RUN apt update \

COPY --from=base--files--debian / /

VOLUME [ "/src", "/target" ]

EXPOSE 1313
WORKDIR /src
USER hugo
Expand Down
2 changes: 2 additions & 0 deletions src/docker/debian/debian.df
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ IMPORT ../_imports/ci.df

IMPORT ../_imports/onbuild.df

VOLUME [ "/src", "/target" ]

FROM main

USER hugo
2 changes: 2 additions & 0 deletions src/docker/ubuntu-ext/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ RUN true \

COPY --from=base--golang / /

VOLUME [ "/src", "/target" ]

IMPORT ../_imports/ci.df

IMPORT ../_imports/onbuild.df
Expand Down
2 changes: 2 additions & 0 deletions src/docker/ubuntu/base.df
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ RUN apt update \
&& chown -R hugo:hugo /src /target \
&& chmod a+wrx /src /target

VOLUME [ "/src", "/target" ]

EXPOSE 1313
WORKDIR /src

Expand Down
2 changes: 2 additions & 0 deletions src/docker/ubuntu/ubuntu.df
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ IMPORT ../_imports/ci.df

IMPORT ../_imports/onbuild.df

VOLUME [ "/src", "/target" ]

FROM main

USER hugo

0 comments on commit db2f7ea

Please sign in to comment.