ENV var bug in Entypoint, so user now without ARG/VAR build/run direct with swsuser

This commit is contained in:
Sven Jörns
2022-11-21 17:07:32 +03:00
parent 793d13dcb3
commit 874a074ef6
2 changed files with 10 additions and 10 deletions
+9 -9
View File
@@ -43,17 +43,17 @@ ENV SWSPORT=${SWSPORT}
#WORKDIR ./${GITPROJECTNAME}/
#RUN zola build --output-dir /public_html
RUN addgroup -g 1000 ${LOCALGROUP} \
&& adduser --system --uid 1000 --ingroup ${LOCALGROUP} ${LOCALUSER}
COPY ./git2zola.sh /home/${LOCALUSER}/git2zola.sh
RUN chown ${LOCALUSER}:${LOCALGROUP} /home/${LOCALUSER}/git2zola.sh
USER ${LOCALUSER}
WORKDIR /home/${LOCALUSER}
&& adduser --system --uid 1000 --ingroup ${LOCALGROUP} swsuser
COPY ./git2zola.sh /home/swsuser/git2zola.sh
RUN chown swsuser:${LOCALGROUP} /home/swsuser/git2zola.sh
USER swsuser
WORKDIR /home/swsuser
RUN pwd && ls -la
RUN chmod +x /home/${LOCALUSER}/git2zola.sh
RUN chmod +x /home/swsuser/git2zola.sh
RUN mkdir public
RUN mkdir .ssh \
&& chmod 700 .ssh \
&& ssh-keygen -q -f /home/${LOCALUSER}/.ssh/id_rsa
RUN cp /home/${LOCALUSER}/.ssh/id_rsa.pub /home/${LOCALUSER}/public/
&& ssh-keygen -q -f /home/swsuser/.ssh/id_rsa
RUN cp /home/swsuser/.ssh/id_rsa.pub /home/swsuser/public/
EXPOSE ${SWSPORT}
ENTRYPOINT ["/home/${LOCALUSER}/git2zola.sh"]
ENTRYPOINT ["/home/swsuser/git2zola.sh"]
+1 -1
View File
@@ -5,4 +5,4 @@ export DOCKER_BUILDKIT=1
# docker secret create gogsserintywebsitepw -
#read -p "enter git user:" GITUSER
#read -s -p "enter git password:" GITPASSWD
docker build --progress=plain --build-arg LOCALUSER='serinty01' --tag sws4zola:latest .
docker build --progress=plain --tag sws4zola:latest .