-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: permission issues on backup images
- Loading branch information
1 parent
4e36560
commit bbe0883
Showing
6 changed files
with
36 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
FROM docker.io/postgres:15.7 AS build | ||
|
||
ARG TARGETARCH | ||
ENV HOME=/home/postgres | ||
ARG USERNAME=postgres | ||
ENV HOME=/home/${USERNAME} | ||
|
||
WORKDIR $HOME | ||
RUN apt update && apt install -y ca-certificates wget && rm -rf /var/lib/apt/lists/* | ||
RUN wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc \ | ||
&& mv mc /usr/bin && chmod +x /usr/bin/mc \ | ||
&& chgrp -R 0 "$HOME" && chmod -R g=u "$HOME" | ||
COPY --chown=postgres:root ./backup.sh ./backup.sh | ||
USER postgres | ||
WORKDIR ${HOME} | ||
RUN chown -R ${USERNAME}:root ${HOME} && chgrp -R 0 ${HOME} && chmod -R g=u ${HOME} | ||
RUN apt update && apt install -y ca-certificates wget && rm -rf /var/lib/apt/lists/* \ | ||
&& wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc \ | ||
&& mv mc /usr/bin && chmod +x /usr/bin/mc | ||
COPY --chown=${USERNAME}:root ./backup.sh ./backup.sh | ||
USER ${USERNAME} | ||
|
||
ENTRYPOINT [ "/bin/sh", "./backup.sh" ] | ||
ENTRYPOINT ["/bin/sh", "./backup.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
FROM docker.io/debian:12 AS build | ||
|
||
ARG TARGETARCH | ||
ENV HOME=/home/debian | ||
ARG USERNAME=debian | ||
ARG USER_UID=1000 | ||
ARG USER_GID=${USER_UID} | ||
ENV HOME=/home/${USERNAME} | ||
|
||
WORKDIR $HOME | ||
RUN apt update && apt install -y ca-certificates wget && rm -rf /var/lib/apt/lists/* | ||
RUN wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc \ | ||
&& mv mc /usr/bin && chmod +x /usr/bin/mc \ | ||
&& chgrp -R 0 "$HOME" && chmod -R g=u "$HOME" | ||
COPY --chown=debian:root ./backup.sh ./backup.sh | ||
USER debian | ||
WORKDIR ${HOME} | ||
RUN groupadd -g ${USER_UID} ${USERNAME} && useradd -m -d ${HOME} -s /bin/bash -g ${USERNAME} -u ${USER_UID} ${USERNAME} \ | ||
&& chown -R ${USERNAME}:root ${HOME} && chgrp -R 0 ${HOME} && chmod -R g=u ${HOME} | ||
RUN apt update && apt install -y ca-certificates wget && rm -rf /var/lib/apt/lists/* \ | ||
&& wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc \ | ||
&& mv mc /usr/bin && chmod +x /usr/bin/mc | ||
COPY --chown=${USERNAME}:root ./backup.sh ./backup.sh | ||
USER ${USERNAME} | ||
|
||
ENTRYPOINT [ "/bin/sh", "./backup.sh" ] | ||
ENTRYPOINT ["/bin/sh", "./backup.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
FROM docker.io/hashicorp/vault:1.17.2 AS build | ||
|
||
ARG TARGETARCH | ||
ENV HOME=/home/vault | ||
ARG USERNAME=vault | ||
ENV HOME=/home/${USERNAME} | ||
|
||
WORKDIR $HOME | ||
WORKDIR ${HOME} | ||
RUN chown -R ${USERNAME}:root ${HOME} && chgrp -R 0 ${HOME} && chmod -R g=u ${HOME} | ||
RUN wget https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc \ | ||
&& mv mc /usr/bin && chmod +x /usr/bin/mc \ | ||
&& chgrp -R 0 "$HOME" && chmod -R g=u "$HOME" | ||
COPY --chown=vault:root ./backup.sh ./backup.sh | ||
USER vault | ||
&& mv mc /usr/bin && chmod +x /usr/bin/mc | ||
COPY --chown=${USERNAME}:root ./backup.sh ./backup.sh | ||
USER ${USERNAME} | ||
|
||
ENTRYPOINT [ "/bin/sh", "./backup.sh" ] | ||
ENTRYPOINT ["/bin/sh", "./backup.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters