forked from hmrc/lambda-s3-bucket-clamav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.jenkins
35 lines (28 loc) · 882 Bytes
/
Dockerfile.jenkins
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
FROM python:2.7.16
# allow user and source root to be passed as args at default to sensibles
ARG APP_USER=jenkins
ARG APP_USER_ID=1000
ARG APP_GROUP_ID=1000
ARG PROJECT_ROOT=/src/
# setup
RUN apt-get update && apt-get install -y \
build-essential \
libssl-dev \
libffi-dev \
make \
bash \
zip \
openssl \
git
# create app dir and user
RUN mkdir -p ${PROJECT_ROOT} && \
addgroup --gid ${APP_GROUP_ID} ${APP_USER} && \
adduser --system --uid ${APP_USER_ID} ${APP_USER} --gid ${APP_GROUP_ID} --disabled-password
# set local directory
WORKDIR ${PROJECT_ROOT}
# install poetry
RUN pip install poetry==1.0.2
# change permissions on our src and home directories so that our user has access
RUN chown -R ${APP_USER}:${APP_USER} ${PROJECT_ROOT} && chown -R ${APP_USER}:${APP_USER} /home/${APP_USER}
# change to our non root user for security purposes
USER ${APP_USER}