Skip to content

Commit 1e58ab9

Browse files
Docker files are updated (NOPASSWD, --chown=test:test) (#22)
1 parent 89b1727 commit 1e58ab9

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
lines changed

Dockerfile--alpine.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ RUN adduser test sudo
2929
EXPOSE 22
3030
RUN ssh-keygen -A
3131

32-
ADD . /home/test/testgres
33-
RUN chown -R test /home/test/testgres
32+
ADD --chown=test:test . /home/test/testgres
3433
WORKDIR /home/test/testgres
3534

3635
# It allows to use sudo without password
37-
RUN sh -c "echo \"test ALL=(ALL:ALL) NOPASSWD:ALL\"">>/etc/sudoers
36+
RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
3837

3938
# THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD
4039
RUN sh -c "echo "test:*" | chpasswd -e"

Dockerfile--altlinux_10.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ FROM base2_with_python-${PYTHON_VERSION} AS final
3434
RUN adduser test -G wheel
3535

3636
# It enables execution of "sudo service ssh start" without password
37-
RUN sh -c "echo \"WHEEL_USERS ALL=(ALL:ALL) NOPASSWD: ALL\"" >> /etc/sudoers
37+
RUN echo "test ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
3838

39-
ADD . /home/test/testgres
40-
RUN chown -R test /home/test/testgres
39+
ADD --chown=test:test . /home/test/testgres
4140
WORKDIR /home/test/testgres
4241

4342
ENV LANG=C.UTF-8

Dockerfile--altlinux_11.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ FROM base2_with_python-${PYTHON_VERSION} AS final
3737
RUN adduser test -G wheel
3838

3939
# It enables execution of "sudo service ssh start" without password
40-
RUN sh -c "echo \"WHEEL_USERS ALL=(ALL:ALL) NOPASSWD: ALL\"" >> /etc/sudoers
40+
RUN echo "test ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
4141

42-
ADD . /home/test/testgres
43-
RUN chown -R test /home/test/testgres
42+
ADD --chown=test:test . /home/test/testgres
4443
WORKDIR /home/test/testgres
4544

4645
ENV LANG=C.UTF-8

Dockerfile--astralinux_1_7.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ RUN useradd -m test
3333
# MY OLD:
3434
# RUN sh -c "echo test ALL=NOPASSWD:ALL" >> /etc/sudoers
3535
# AI:
36-
RUN echo "test ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
36+
RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
3737

3838
# THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD
3939
RUN sh -c "echo "test:*" | chpasswd -e"
4040
RUN sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
4141

42-
ADD . /home/test/testgres
43-
RUN chown -R test /home/test/testgres
42+
ADD --chown=test:test . /home/test/testgres
4443
WORKDIR /home/test/testgres
4544

4645
ENV LANG=C.UTF-8

Dockerfile--ubuntu_24_04.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ RUN ssh-keygen -A
2929
RUN useradd -m test
3030

3131
# It enables execution of "sudo service ssh start" without password
32-
RUN sh -c "echo test ALL=NOPASSWD:/usr/sbin/service ssh start" >> /etc/sudoers
32+
RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
3333

34-
ADD . /home/test/testgres
35-
RUN chown -R test /home/test/testgres
34+
ADD --chown=test:test . /home/test/testgres
3635
WORKDIR /home/test/testgres
3736

3837
ENV LANG=C.UTF-8

0 commit comments

Comments
 (0)