Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions Dockerfile--alpine.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,34 @@ ARG PYTHON_VERSION=3.12
# --------------------------------------------- base1
FROM python:${PYTHON_VERSION}-alpine AS base1

RUN apk add --no-cache coreutils
RUN apk add --no-cache \
coreutils \
bash \
mc \
procps \
openssh \
sshpass \
sudo \
git

# --------------------------------------------- base2
FROM base1 AS base2

RUN apk add python3-dev build-base musl-dev linux-headers
RUN apk add git
RUN apk add --no-cache \
python3-dev \
build-base\
musl-dev \
linux-headers

# --------------------------------------------- final
FROM base2 AS final

RUN apk add mc
RUN apk add bash

# Full version of "ps" command
RUN apk add --no-cache procps

RUN apk add --no-cache openssh
RUN apk add --no-cache sudo

RUN adduser -D test

RUN addgroup -S sudo
RUN adduser test sudo
RUN adduser -D test && addgroup -S sudo && adduser test sudo

EXPOSE 22
RUN ssh-keygen -A

ADD --chown=test:test . /home/test/testgres
COPY --chown=test:test . /home/test/testgres
WORKDIR /home/test/testgres

# It allows to use sudo without password
Expand Down
60 changes: 32 additions & 28 deletions Dockerfile--altlinux_10.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,56 @@ ARG PYTHON_VERSION=3
# --------------------------------------------- base1
FROM alt:p10 AS base1

RUN apt-get update
RUN apt-get install -y sudo curl ca-certificates
RUN apt-get update
RUN apt-get install -y openssh-server openssh-clients
RUN apt-get install -y time

# RUN apt-get install -y mc

EXPOSE 22

RUN ssh-keygen -A

# --------------------------------------------- dev_tools
FROM base1 AS base1_with_dev_tools

RUN apt-get update
RUN apt-get install -y git
RUN apt-get update && apt-get install -y \
sudo \
curl \
ca-certificates \
openssh-server \
openssh-clients \
sshpass \
time \
su \
git \
&& apt-get clean

# --------------------------------------------- base2_with_python-3
FROM base1_with_dev_tools AS base2_with_python-3
RUN apt-get install -y python3
RUN apt-get install -y python3-dev
FROM base1 AS base2_with_python-3

RUN apt-get update && apt-get install -y \
python3 \
python3-dev \
&& apt-get clean

ENV PYTHON_VERSION=3

# --------------------------------------------- final
FROM base2_with_python-${PYTHON_VERSION} AS final

EXPOSE 22
RUN ssh-keygen -A

RUN adduser test -G wheel

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

ADD --chown=test:test . /home/test/testgres
#
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
#
# AI: SPEED UP SSH 6 TIMES (REMOVE REVERSE DNS LOOKUP TIMEOUTS)
#
RUN echo "UseDNS no" >> /etc/openssh/sshd_config

COPY --chown=test:test . /home/test/testgres
WORKDIR /home/test/testgres

ENV LANG=C.UTF-8

USER test
RUN chmod 700 /home/test/ && \
mkdir -p /home/test/.ssh && \
chown -R test:test /home/test/.ssh

RUN chmod 700 ~/
RUN mkdir -p ~/.ssh

#
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
#
USER test

ENTRYPOINT sh -c " \
set -eux; \
Expand Down
64 changes: 33 additions & 31 deletions Dockerfile--altlinux_11.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,57 @@ ARG PYTHON_VERSION=3
# --------------------------------------------- base1
FROM alt:p11 AS base1

RUN apt-get update
RUN apt-get install -y sudo curl ca-certificates
RUN apt-get update
RUN apt-get install -y openssh-server openssh-clients
RUN apt-get install -y time

# pgrep (for testgres.os_ops)
RUN apt-get install -y procps

# RUN apt-get install -y mc

EXPOSE 22

RUN ssh-keygen -A

# --------------------------------------------- dev_tools
FROM base1 AS base1_with_dev_tools

RUN apt-get update
RUN apt-get install -y git
RUN apt-get update && apt-get install -y \
sudo \
curl \
ca-certificates \
openssh-server \
openssh-clients \
sshpass \
time \
su \
git \
procps \
&& apt-get clean

# --------------------------------------------- base2_with_python-3
FROM base1_with_dev_tools AS base2_with_python-3
RUN apt-get install -y python3
RUN apt-get install -y python3-dev
FROM base1 AS base2_with_python-3

RUN apt-get update && apt-get install -y \
python3 \
python3-dev \
&& apt-get clean

ENV PYTHON_VERSION=3

# --------------------------------------------- final
FROM base2_with_python-${PYTHON_VERSION} AS final

EXPOSE 22
RUN ssh-keygen -A

RUN adduser test -G wheel

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

ADD --chown=test:test . /home/test/testgres
#
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
#
# AI: SPEED UP SSH 6 TIMES (REMOVE REVERSE DNS LOOKUP TIMEOUTS)
#
RUN echo "UseDNS no" >> /etc/openssh/sshd_config

COPY --chown=test:test . /home/test/testgres
WORKDIR /home/test/testgres

ENV LANG=C.UTF-8

USER test
RUN chmod 700 /home/test/ && \
mkdir -p /home/test/.ssh && \
chown -R test:test /home/test/.ssh

RUN chmod 700 ~/
RUN mkdir -p ~/.ssh

#
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
#
USER test

ENTRYPOINT sh -c " \
set -eux; \
Expand Down
37 changes: 21 additions & 16 deletions Dockerfile--astralinux_1_7.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,33 @@ ARG PYTHON_VERSION=3
# --------------------------------------------- base1
FROM packpack/packpack:astra-1.7 AS base1

RUN apt update
RUN apt install -y sudo curl ca-certificates
RUN apt update
RUN apt install -y openssh-server
# RUN apt install -y time
# RUN apt install -y netcat-traditional

RUN apt install -y git

# RUN apt install -y mc
# RUN apt install -y nano
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
curl \
ca-certificates \
openssh-server \
sshpass \
iproute2 \
git \
&& rm -rf /var/lib/apt/lists/*

# --------------------------------------------- base2_with_python-3
FROM base1 AS base2_with_python-3
RUN apt install -y python3 python3-dev python3-venv

RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-dev \
python3-venv \
&& rm -rf /var/lib/apt/lists/*

ENV PYTHON_VERSION=3

# --------------------------------------------- final
FROM base2_with_python-${PYTHON_VERSION} AS final

EXPOSE 22

RUN ssh-keygen -A

RUN useradd -m test
Expand All @@ -36,10 +41,10 @@ RUN useradd -m test
RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers

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

ADD --chown=test:test . /home/test/testgres
COPY --chown=test:test . /home/test/testgres
WORKDIR /home/test/testgres

ENV LANG=C.UTF-8
Expand Down
33 changes: 21 additions & 12 deletions Dockerfile--ubuntu_24_04.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,44 @@ ARG PYTHON_VERSION=3
# --------------------------------------------- base1
FROM ubuntu:24.04 AS base1

RUN apt update
RUN apt install -y sudo curl ca-certificates
RUN apt update
RUN apt install -y openssh-server
RUN apt install -y time
RUN apt install -y netcat-traditional
# Disable interactive apt questions so that the build doesn't hang when setting time zones
ENV DEBIAN_FRONTEND=noninteractive

RUN apt install -y git

# RUN apt install -y mc
RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
curl \
ca-certificates \
openssh-server \
sshpass \
time \
netcat-traditional \
iproute2 \
git \
&& rm -rf /var/lib/apt/lists/*

# --------------------------------------------- base2_with_python-3
FROM base1 AS base2_with_python-3
RUN apt install -y python3 python3-dev python3-venv

RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-dev \
python3-venv \
&& rm -rf /var/lib/apt/lists/*

ENV PYTHON_VERSION=3

# --------------------------------------------- final
FROM base2_with_python-${PYTHON_VERSION} AS final

EXPOSE 22

RUN ssh-keygen -A

RUN useradd -m test

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

ADD --chown=test:test . /home/test/testgres
COPY --chown=test:test . /home/test/testgres
WORKDIR /home/test/testgres

ENV LANG=C.UTF-8
Expand Down