-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile--altlinux_11.tmpl
More file actions
67 lines (48 loc) · 1.58 KB
/
Dockerfile--altlinux_11.tmpl
File metadata and controls
67 lines (48 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
ARG PYTHON_VERSION
# --------------------------------------------- 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
# --------------------------------------------- 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
ENV PYTHON_VERSION=3
# --------------------------------------------- final
FROM base2_with_python-${PYTHON_VERSION} AS final
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
WORKDIR /home/test/testgres
ENV LANG=C.UTF-8
USER test
RUN chmod 700 ~/
RUN mkdir -p ~/.ssh
#
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
#
ENTRYPOINT sh -c " \
set -eux; \
echo HELLO FROM ENTRYPOINT; \
echo HOME DIR IS [`realpath ~/`]; \
sudo /usr/sbin/sshd; \
ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \
ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \
ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \
chmod 600 ~/.ssh/authorized_keys; \
ls -la ~/.ssh/; \
TEST_FILTER=\"\" bash ./run_tests3.sh;"