forked from postgrespro/testgres.os_ops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile--altlinux_10.tmpl
More file actions
69 lines (50 loc) · 1.7 KB
/
Dockerfile--altlinux_10.tmpl
File metadata and controls
69 lines (50 loc) · 1.7 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
68
69
ARG PYTHON_VERSION
# --------------------------------------------- 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
RUN apt-get install -y libsqlite3-devel
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
# RUN apt-get install -y python3-module-virtualenv
RUN apt-get install -y python3-modules-sqlite3
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 sh -c "echo \"WHEEL_USERS ALL=(ALL:ALL) NOPASSWD: ALL\"" >> /etc/sudoers
ADD . /home/test/testgres
RUN chown -R 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;"