forked from postgrespro/testgres
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile--std.tmpl
More file actions
41 lines (31 loc) · 1.03 KB
/
Dockerfile--std.tmpl
File metadata and controls
41 lines (31 loc) · 1.03 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
ARG PG_VERSION
ARG PYTHON_VERSION
# --------------------------------------------- base1
FROM postgres:${PG_VERSION}-alpine AS base1
# --------------------------------------------- base2_with_python-3
FROM base1 AS base2_with_python-3
RUN apk add --no-cache curl python3 python3-dev build-base musl-dev linux-headers
ENV PYTHON_BINARY=python3
# --------------------------------------------- final
FROM base2_with_python-${PYTHON_VERSION} AS final
RUN apk add --no-cache git
RUN apk add --no-cache sudo
ENV LANG=C.UTF-8
RUN addgroup -S sudo
RUN adduser -D test
RUN addgroup test sudo
ADD --chown=test:test . /home/test/testgres
WORKDIR /home/test/testgres
RUN mkdir /home/test/testgres/logs
RUN chown -R test:test /home/test/testgres/logs
# It allows to use sudo without password
RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
USER test
ENTRYPOINT sh -c " \
set -eux; \
echo HELLO FROM ENTRYPOINT; \
echo HOME DIR IS [`realpath ~/`]; \
ls -la .; \
sudo chmod 777 /home/test/testgres/logs; \
ls -la . | grep logs; \
bash run_tests.sh;"