-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (40 loc) · 1.54 KB
/
Copy pathDockerfile
File metadata and controls
52 lines (40 loc) · 1.54 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
ARG CORE_TAG
FROM dwolla/jenkins-agent-core:${CORE_TAG}
LABEL maintainer="Dwolla Dev <dev+jenkins-agent-core@dwolla.com>"
LABEL org.label-schema.vcs-url="https://github.com/Dwolla/jenkins-agent-docker-python"
USER root
RUN set -ex && \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install git -y && \
apt-get install -y \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libffi-dev \
liblzma-dev \
default-libmysqlclient-dev
# Install xmlsec C library dependencies. This needs the build script to be copied into
# the container and run as root. THIS IS TEMPORARY AND CAN BE REMOVED ONCE THESE
# PACKAGES ARE UPDATED IN LINUX AND/OR THE JENKINS IMAGE.
ARG TARGETPLATFORM
COPY scripts/build_xmlsec_3_7.sh /tmp/build_xmlsec.sh
# These only run for Linux architectures.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ] || [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
chmod +x /tmp/build_xmlsec.sh && /tmp/build_xmlsec.sh; \
fi
RUN chown -R jenkins ${JENKINS_HOME}
ENV PYENV_ROOT $JENKINS_HOME/.pyenv
ENV PATH $PYENV_ROOT/bin:$PATH
RUN curl https://pyenv.run | bash && \
eval "$(pyenv init --path)" && \
echo 'eval "$(pyenv virtualenv-init -)"' >> "${JENKINS_HOME}/.bashrc"
RUN chown -R jenkins:jenkins "${JENKINS_HOME}/.pyenv"
USER jenkins
RUN pyenv install 3.11
RUN pyenv global 3.11
# Prepend shims so `python3` / `pip` use pyenv (not Debian /usr/bin/python3).
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH