-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DRAFT] control-service: fine-tune the job-builder-secure
Signed-off-by: Miroslav Ivanov [email protected]
- Loading branch information
1 parent
7ac0c54
commit a2eb398
Showing
7 changed files
with
118 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 94 additions & 5 deletions
99
projects/control-service/projects/job-base-image-secure/Dockerfile-data-job-base
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,98 @@ | ||
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices | ||
ARG base_image | ||
FROM $base_image as base | ||
FROM photon:latest as build | ||
|
||
ARG PYTHON_MAJOR | ||
ARG PYTHON_MINOR | ||
ARG PYTHON_PATCH | ||
ARG PYTHON_VERSION=${PYTHON_MAJOR}.${PYTHON_MINOR}.${PYTHON_PATCH} | ||
|
||
ARG _prefixdir=/usr/local | ||
ARG _bindir=${_prefixdir}/bin | ||
ARG _libdir=${_prefixdir}/lib | ||
ARG _workdir=/usr/src | ||
ARG _pylibdir=${_libdir}/python${PYTHON_MAJOR}.${PYTHON_MINOR} | ||
ARG _bytecode_suffixes=.cpython-*.pyc | ||
|
||
ENV PATH=${_bindir}:${PATH} | ||
WORKDIR ${_workdir} | ||
|
||
# Install build dependencies | ||
RUN yum install -y \ | ||
coreutils \ | ||
gcc \ | ||
glibc-devel \ | ||
binutils \ | ||
build-essential \ | ||
wget \ | ||
make \ | ||
openssl-devel \ | ||
bzip2-devel \ | ||
libffi-devel \ | ||
zlib-devel \ | ||
sqlite-devel \ | ||
krb5-devel \ | ||
e2fsprogs-devel | ||
|
||
# Extract python source | ||
RUN : \ | ||
&& set -ex \ | ||
&& curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz \ | ||
&& tar -xvzf Python-${PYTHON_VERSION}.tgz \ | ||
&& mv Python-${PYTHON_VERSION} python \ | ||
&& rm Python-${PYTHON_VERSION}.tgz | ||
|
||
# Build and install python | ||
RUN : \ | ||
&& set -ex \ | ||
&& cd ${_workdir}/python \ | ||
&& ./configure ax_cv_c_float_words_bigendian=no \ | ||
--enable-loadable-sqlite-extensions \ | ||
--enable-optimizations \ | ||
--enable-option-checking=fatal \ | ||
--enable-shared \ | ||
--with-lto \ | ||
--without-ensurepip \ | ||
--prefix=${_prefixdir} \ | ||
LDFLAGS=-Wl,-rpath=${_libdir} \ | ||
&& make \ | ||
&& make install | ||
|
||
# Make some useful symlinks | ||
RUN : \ | ||
&& set -ex \ | ||
&& cd ${_bindir} \ | ||
&& ln -s python${PYTHON_MAJOR} python | ||
|
||
# Get and install pip | ||
RUN : \ | ||
&& set -ex \ | ||
&& curl -O https://bootstrap.pypa.io/get-pip.py \ | ||
&& python get-pip.py \ | ||
&& pip --version \ | ||
&& rm -f get-pip.py | ||
|
||
# Cleanup files | ||
RUN : \ | ||
&& set -ex \ | ||
&& rm -rf \ | ||
${_workdir}/python \ | ||
${_pylibdir}/turtle.py \ | ||
${_pylibdir}/__pycache__/turtle*${_bytecode_suffixes} \ | ||
${_bindir}/idle* \ | ||
${_pylibdir}/idlelib \ | ||
${_pylibdir}/tkinter \ | ||
${_pylibdir}/turtledemo \ | ||
${_pylibdir}/ctypes/test \ | ||
${_pylibdir}/distutils/tests \ | ||
${_pylibdir}/lib2to3/tests \ | ||
${_pylibdir}/sqlite3/test \ | ||
${_pylibdir}/test \ | ||
${_pylibdir}/tkinter/test \ | ||
${_pylibdir}/unittest/test \ | ||
&& find ${_pylibdir} -type d -name __pycache__ -exec rm -rf '{}' + | ||
|
||
FROM photon:latest | ||
|
||
# Copies essential binaries, libraries, headers, and Python files from the base Python image, | ||
# excluding build dependencies. | ||
COPY --from=base /usr/local/ /usr/local/ | ||
# Copies essential binaries, libraries, headers, and Python files from the base Python image, | ||
# excluding build dependencies. | ||
COPY --from=build /usr/local/ /usr/local/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 0 additions & 98 deletions
98
projects/control-service/projects/python-image-secure/Dockerfile-python
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
projects/control-service/projects/python-image-secure/README.md
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.