-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_python_nodejs
67 lines (57 loc) · 2.38 KB
/
Dockerfile_python_nodejs
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
FROM alpine AS base
ARG OPENSSL_VERSION=3.1.5
ARG PYTHON_VERSION=3.11.8
ENV PATH /usr/local/bin:$PATH
ENV LANG C.UTF-8
# Install OpenSSL FIPS
RUN set -ex \
&& apk add --no-cache --virtual .build-deps make gcc libgcc musl-dev linux-headers perl vim \
&& wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
&& tar -xf openssl-${OPENSSL_VERSION}.tar.gz \
&& cd openssl-${OPENSSL_VERSION} \
&& ./Configure enable-fips shared enable-ec_nistp_64_gcc_128 \
&& make \
&& make install \
&& make install_fips \
&& cp -a /etc/ssl/certs/* /usr/local/ssl/certs/ \
&& cp -a /etc/ssl/cert.pem /usr/local/ssl/ \
&& apk del .build-deps \
&& cd .. \
&& rm -rf openssl-${OPENSSL_VERSION}.tar.gz openssl-${OPENSSL_VERSION}
COPY openssl.cnf /etc/ssl/openssl.cnf
ENV OPENSSL_FIPS=1
ENV OPENSSL_DIR=/usr/local
ENV OPENSSL_CONF=/etc/ssl/openssl.cnf
ENV OPENSSL_MODULES=/usr/local/lib64/ossl-modules
ENV LDFLAGS="-L/usr/local/lib/ -L/usr/local/lib64/"
ENV LD_LIBRARY_PATH="/usr/local/lib/:/usr/local/lib64/"
ENV CPPFLAGS="-I/usr/local/include -I/usr/local/include/openssl"
ENV CFLAGS="-I/usr/local/include"
# Install Python
RUN set -ex \
&& apk add --no-cache --virtual .build-deps make gcc libgcc musl-dev linux-headers perl vim tcl-dev tk-dev bzip2-dev zlib-dev libffi-dev cups-dev krb5-dev yaml-dev sqlite-dev libffi-dev libxml2-dev libxslt-dev \
&& wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz \
&& tar -xvf Python-${PYTHON_VERSION}.tgz \
&& cd Python-${PYTHON_VERSION} \
&& ./configure --enable-optimizations --enable-shared --with-ensurepip=no \
&& make \
&& make install \
&& cd .. \
&& apk del .build-deps \
&& ln -sf /usr/local/bin/idle3 /usr/local/bin/idle \
&& ln -sf /usr/local/bin/pydoc3 /usr/local/bin/pydoc \
&& ln -sf /usr/local/bin/python3 /usr/local/bin/python \
&& ln -sf /usr/local/bin/python3-config /usr/local/bin/python-config \
&& rm -f Python-${PYTHON_VERSION}.tgz \
&& rm -rf Python-${PYTHON_VERSION}
# Install deps
RUN set -ex \
&& apk add --no-cache libintl libffi rust cargo pkgconfig
RUN set -ex \
&& apk add --no-cache curl \
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python3 get-pip.py \
&& rm get-pip.py \
&& pip install cryptography --no-binary cryptography
RUN set -ex \
&& apk add nodejs npm yarn