run as non-root in docker
This commit is contained in:
parent
8fa301b5a3
commit
cb432015b5
2 changed files with 12 additions and 0 deletions
|
|
@ -25,4 +25,11 @@ COPY gpgparams entrypoint.sh /protonmail/
|
||||||
# Copy protonmail
|
# Copy protonmail
|
||||||
COPY --from=build /build/proton-bridge/proton-bridge /protonmail/
|
COPY --from=build /build/proton-bridge/proton-bridge /protonmail/
|
||||||
|
|
||||||
|
# Add a user 'protonmail' with UID 8535
|
||||||
|
RUN useradd -u 8535 -d /home/protonmail protonmail \
|
||||||
|
&& mkdir -p /home/protonmail \
|
||||||
|
&& chown protonmail: /home/protonmail
|
||||||
|
# change to non-privileged user for extra security
|
||||||
|
USER protonmail
|
||||||
|
|
||||||
ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"]
|
ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"]
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
id
|
||||||
|
# Go to current user's homedir
|
||||||
|
cd
|
||||||
|
echo $PWD
|
||||||
|
|
||||||
# Initialize
|
# Initialize
|
||||||
if [[ $1 == init ]]; then
|
if [[ $1 == init ]]; then
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue