Skip to content

Commit 0b872e8

Browse files
Docker files are updated (NOPASSWD) (#335)
* Dockerfile--ubuntu_24_04.tmpl is updated (NOPASSWD) Main: A rule for NOPASSWD mode is updated (thanks to AI). * Dockerfile--altlinux_1x.tmpl is updated (NOPASSWD)
1 parent a5deab6 commit 0b872e8

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

Dockerfile--altlinux_10.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ FROM base2_with_python-${PYTHON_VERSION} AS final
7373
RUN adduser test -G wheel
7474

7575
# It enables execution of "sudo service ssh start" without password
76-
RUN echo "WHEEL_USERS ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
76+
RUN echo "test ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
7777

7878
ADD --chown=test:test . /home/test/testgres
7979
WORKDIR /home/test/testgres

Dockerfile--altlinux_11.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ FROM base2_with_python-${PYTHON_VERSION} AS final
7676
RUN adduser test -G wheel
7777

7878
# It enables execution of "sudo service ssh start" without password
79-
RUN echo "WHEEL_USERS ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
79+
RUN echo "test ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
8080

8181
ADD --chown=test:test . /home/test/testgres
8282
WORKDIR /home/test/testgres

Dockerfile--ubuntu_24_04.tmpl

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ RUN apt install -y openssh-server
1212
RUN apt install -y time
1313
RUN apt install -y netcat-traditional
1414

15+
RUN apt install -y git
16+
1517
RUN apt update
1618
RUN apt install -y postgresql-common
1719

@@ -20,16 +22,9 @@ RUN bash /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
2022
RUN install -d /usr/share/postgresql-common/pgdg
2123
RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
2224

23-
# It does not work
24-
# RUN sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
25-
2625
RUN apt update
2726
RUN apt install -y postgresql-${PG_VERSION}
2827

29-
EXPOSE 22
30-
31-
RUN ssh-keygen -A
32-
3328
# --------------------------------------------- base2_with_python-3
3429
FROM base1 AS base2_with_python-3
3530
RUN apt install -y python3 python3-dev python3-venv libpq-dev build-essential
@@ -38,16 +33,19 @@ ENV PYTHON_BINARY=python3
3833
# --------------------------------------------- final
3934
FROM base2_with_python-${PYTHON_VERSION} AS final
4035

41-
RUN apt install -y git
36+
EXPOSE 22
37+
38+
RUN ssh-keygen -A
4239

4340
RUN adduser test
4441
RUN chown postgres:postgres /var/run/postgresql
4542
RUN chmod 775 /var/run/postgresql
4643
RUN usermod -aG postgres test
4744

4845
# It enables execution of "sudo service ssh start" without password
49-
#RUN echo "test ALL=NOPASSWD:/usr/sbin/service ssh start" >> /etc/sudoers
50-
RUN echo "test ALL=NOPASSWD:ALL" >> /etc/sudoers
46+
# RUN echo "test ALL=NOPASSWD:/usr/sbin/service ssh start" >> /etc/sudoers
47+
# RUN echo "test ALL=NOPASSWD:ALL" >> /etc/sudoers
48+
RUN echo "test ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
5149

5250
ADD --chown=test:test . /home/test/testgres
5351
WORKDIR /home/test/testgres

0 commit comments

Comments
 (0)