-
Notifications
You must be signed in to change notification settings - Fork 7
Refactoring of Dockerfile #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ludgerpaehler
wants to merge
10
commits into
main
Choose a base branch
from
lp/Dockerfile-cpp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5ce22f3
Break out previous Dockerfile into smaller, separate Dockerfiles for …
ludgerpaehler e28fb36
Break out of the Dockerfile into its separate pieces.
ludgerpaehler 7ff854d
Dockerfile for the environment for C++ also acts as the Dockerfile fo…
ludgerpaehler a9e7c3e
Julia Dockerfile broken out.
ludgerpaehler e645bfd
Delete legacy Dockerfile.
ludgerpaehler 9126a88
Finished C++ Dockerfile.
ludgerpaehler 9cf7228
Dockerfile for the Julia dependencies.
ludgerpaehler d2c71a1
Rust-specific Dockerfile.
ludgerpaehler 7bfc7bc
Dockerfile for the Swift-reliant builders.
ludgerpaehler 8cae538
Dockerfile convention.
ludgerpaehler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Dockerfile.cpp_env | ||
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
ARG UBUNTU_VERSION=22.04 | ||
ARG CUSTOM_CERT | ||
ARG ENABLE_LEGACY_RENEGOTIATION | ||
|
||
FROM ubuntu:$UBUNTU_VERSION | ||
|
||
ARG CUSTOM_CERT | ||
ARG ENABLE_LEGACY_RENEGOTIATION | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install the base dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
python3 \ | ||
python3-dev \ | ||
python-is-python3 \ | ||
wget \ | ||
curl \ | ||
ca-certificates \ | ||
gcc \ | ||
g++ \ | ||
gfortran \ | ||
cmake \ | ||
ninja-build \ | ||
git \ | ||
libssl-dev | ||
|
||
# Setup a custom certificate/SSL settings depending upon build arguments | ||
# Include README.md here so that the build doesn't fail if there is no custom | ||
# certificate specified. Then we just delete it afterwards. | ||
COPY README.md $CUSTOM_CERT /usr/local/share/ca-certificates/ | ||
RUN rm /usr/local/share/ca-certificates/README.md \ | ||
&& update-ca-certificates | ||
RUN if [ -n "$ENABLE_LEGACY_RENEGOTIATION" ]; then echo "Options = UnsafeLegacyRenegotiation" >> /etc/ssl/openssl.cnf ; fi | ||
|
||
# LLVM Installation | ||
RUN git clone -b running-fixes --depth=1 https://github.com/llvm-ml/llvm-project \ | ||
&& mkdir /llvm-project/build \ | ||
&& cd /llvm-project/build \ | ||
&& cmake -GNinja \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DLLVM_ENABLE_PROJECTS="clang;lld" \ | ||
-DLLVM_ENABLE_RUNTIMES="compiler-rt;openmp" \ | ||
-DCMAKE_INSTALL_PREFIX=/usr \ | ||
-DLLVM_TARGETS_TO_BUILD=Native \ | ||
-DLLVM_ENABLE_ASSERTIONS=ON \ | ||
../llvm \ | ||
&& ninja install \ | ||
&& cd / \ | ||
&& rm -rf /llvm-project | ||
|
||
# Set up the Python dependencies | ||
COPY Pipfile* ./ | ||
RUN pip3 install pipenv \ | ||
&& pipenv sync --categories "packages dev-packages" --system \ | ||
&& pipenv --clear \ | ||
&& rm Pipfile* | ||
|
||
# Clean up the Docker container to make the image smaller | ||
RUN apt-get autoremove -y --purge \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV DEBIAN_FRONTEND= |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
ARG UBUNTU_VERSION=22.04 | ||
ARG CUSTOM_CERT | ||
ARG ENABLE_LEGACY_RENEGOTIATION | ||
|
||
FROM ubuntu:$UBUNTU_VERSION | ||
|
||
ARG CUSTOM_CERT | ||
ARG ENABLE_LEGACY_RENEGOTIATION | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install the base dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
python3 \ | ||
python3-dev \ | ||
python-is-python3 \ | ||
wget \ | ||
curl \ | ||
ca-certificates \ | ||
build-essential \ | ||
pkg-config \ | ||
bzip2 \ | ||
gcc \ | ||
g++ \ | ||
gfortran \ | ||
cmake \ | ||
ninja-build \ | ||
git \ | ||
make \ | ||
libssl-dev | ||
|
||
# Setup a custom certificate/SSL settings depending upon build arguments | ||
# Include README.md here so that the build doesn't fail if there is no custom | ||
# certificate specified. Then we just delete it afterwards. | ||
COPY README.md $CUSTOM_CERT /usr/local/share/ca-certificates/ | ||
RUN rm /usr/local/share/ca-certificates/README.md \ | ||
&& update-ca-certificates | ||
RUN if [ -n "$ENABLE_LEGACY_RENEGOTIATION" ]; then echo "Options = UnsafeLegacyRenegotiation" >> /etc/ssl/openssl.cnf ; fi | ||
|
||
# Install Julia | ||
RUN git clone -b emit-per-package-bitcode --depth=1 https://github.com/llvm-ml/julia /julia \ | ||
&& cd /julia \ | ||
&& make MARCH=x86-64 -j $(nproc) \ | ||
&& echo prefix=/usr > Make.user \ | ||
&& make MARCH=x86-64 install \ | ||
&& cd / \ | ||
&& rm -rf /julia | ||
|
||
# Set up the Python dependencies | ||
COPY Pipfile* ./ | ||
RUN pip3 install pipenv \ | ||
&& pipenv sync --categories "packages dev-packages" --system \ | ||
&& pipenv --clear \ | ||
&& rm Pipfile* | ||
|
||
# Clean up the Docker container to make the image smaller | ||
RUN apt-get autoremove -y --purge \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV DEBIAN_FRONTEND= |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think C and C++ need a separate container. It's not even possible to build
clang
with support for only one or the other and system packages between them will probably have a large amount of overlap.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C is only a symbolic link to the C++ container, but just having it in there for continuity's sake s.t. every language has its own container..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why though? We collect C and C++ from the same builders (spack and Gentoo, although Gentoo needs its own container).