Skip to content

Commit bcda489

Browse files
TrevorBensonrdlrt
andauthored
Docker stable slim adduser missing (#1891)
## Description The debian slim image no longer has the adduser wrapper script, causing the docker build to fail to add the user. ## Which issue it fixes? Closes #1888 (opened by me, reported to me by @hodlonaut) --- Additionally this removes the sudo installation and usage during the build process. The root user can still be used via `docker exec -it -u root bash` if an operator wishes to manage the container without rebuilding it. --------- Co-authored-by: RdLrT <[email protected]>
1 parent 361f5dd commit bcda489

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

files/docker/node/dockerfile_bin

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ENV \
2424
SUDO=N
2525
ENV CARDANO_NODE_SOCKET_PATH=${CNODE_HOME}/sockets/node.socket
2626

27-
RUN apt-get update && apt-get install --no-install-recommends -y locales apt-utils sudo \
27+
RUN apt-get update && apt-get install --no-install-recommends -y locales apt-utils \
2828
&& apt install -y curl wget udev jq \
2929
&& apt-get -y purge \
3030
&& apt-get -y clean \
@@ -34,11 +34,10 @@ RUN apt-get update && apt-get install --no-install-recommends -y locales apt-uti
3434
&& locale-gen \
3535
&& echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc \
3636
&& echo "export LANG=en_US.UTF-8" >> ~/.bashrc \
37-
&& echo "export LANGUAGE=en_US.UTF-8" >> ~/.bashrc \
38-
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
37+
&& echo "export LANGUAGE=en_US.UTF-8" >> ~/.bashrc
3938

40-
RUN adduser --disabled-password --gecos '' guild \
41-
&& adduser guild sudo \
39+
RUN useradd -m -U -s /bin/bash -c '' guild \
40+
&& passwd -l guild \
4241
&& mkdir -pv ${USER_HOME}/.local/ ${USER_HOME}/.scripts/
4342

4443
RUN set -x && apt update \
@@ -103,8 +102,11 @@ ADD https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${GUILD_DEPLO
103102
https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${GUILD_DEPLOY_BRANCH}/scripts/cnode-helper-scripts/mithril-relay.sh ${CNODE_HOME}/scripts/
104103
ADD https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${GUILD_DEPLOY_BRANCH}/files/docker/node/addons/entrypoint.sh ./
105104

106-
RUN sudo chmod -R a+rx ${USER_HOME}/.scripts/*.sh ${CNODE_HOME}/scripts/*.sh ${USER_HOME}/entrypoint.sh /conf \
107-
&& sudo chown -R guild:guild ${USER_HOME}/.* ${CNODE_HOME} /conf
105+
USER root
106+
RUN chmod -R a+rx ${USER_HOME}/.scripts/*.sh ${CNODE_HOME}/scripts/*.sh ${USER_HOME}/entrypoint.sh /conf \
107+
&& chown -R guild:guild ${USER_HOME}/.* ${CNODE_HOME} /conf
108+
109+
USER guild
108110

109111
HEALTHCHECK --start-period=5m --interval=120s --timeout=120s CMD ${CNODE_HOME}/scripts/healthcheck.sh
110112

0 commit comments

Comments
 (0)