-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds basic Dockefiles for dev containers (ubuntu+fedora with GNU tool…
…set).
- Loading branch information
Showing
3 changed files
with
183 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Recipe to build a Dev image for gcc and gfortran with Boost 1.87.0 (custom-built) | ||
# Build with: | ||
# docker build -t aristos86/dev-fedora38-boost1870:latest -f Dockerfile.fedora.38 . | ||
# Run with: | ||
# docker run -it --rm -v $(pwd):/app aristos86/dev-fedora38-boost1870 /bin/bash | ||
|
||
# Stage 1: Build Boost | ||
# Use a lightweight Fedora image as the base | ||
FROM fedora:38 AS build | ||
|
||
# Install essential tools for building Boost | ||
# Update the package lists | ||
RUN dnf update -y | ||
|
||
# Install essential development tools | ||
RUN dnf install -y \ | ||
gcc-c++ \ | ||
cmake \ | ||
make \ | ||
git \ | ||
wget \ | ||
tar \ | ||
&& dnf autoremove -y | ||
|
||
# Define Boost version | ||
ENV BOOST_VERSION=1.87.0 | ||
ENV BOOST_DIR=boost_1_87_0 | ||
|
||
# Download and build Boost | ||
RUN wget https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_DIR}.tar.gz \ | ||
&& tar -xzf ${BOOST_DIR}.tar.gz \ | ||
&& cd ${BOOST_DIR} \ | ||
&& ./bootstrap.sh \ | ||
&& ./b2 install --prefix=/opt/boost --without-python cxxstd=17 link=shared runtime-link=shared | ||
|
||
# Stage 2: Final Image | ||
FROM fedora:38 | ||
|
||
# Install runtime dependencies | ||
RUN dnf update -y | ||
RUN dnf install -y \ | ||
gcc-c++ \ | ||
gcc-gfortran \ | ||
cmake \ | ||
make \ | ||
git \ | ||
vim \ | ||
&& dnf autoremove -y \ | ||
&& dnf clean all \ | ||
&& rm -rf /var/cache/dnf | ||
|
||
# Copy Boost from the build stage | ||
COPY --from=build /opt/boost /opt/boost | ||
|
||
# Add Boost to environment variables | ||
ENV BOOST_ROOT=/opt/boost | ||
ENV LD_LIBRARY_PATH=/opt/boost/lib | ||
ENV PATH=/opt/boost/bin:$PATH | ||
|
||
# Add a non-root user for development | ||
RUN useradd -ms /bin/bash devuser | ||
USER devuser | ||
WORKDIR /home/devuser |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Recipe to build a Dev image for gcc and gfortran with Boost 1.87.0 (custom-built) | ||
# Build with: | ||
# docker build -t aristos86/dev-ubuntu2204-boost1870:latest -f Dockerfile.ubuntu.22.04 . | ||
# Run with: | ||
# docker run -it --rm -v $(pwd):/app aristos86/dev-ubuntu2204-boost1870 /bin/bash | ||
|
||
# Stage 1: Build Boost | ||
FROM ubuntu:22.04 AS build | ||
|
||
# Install essential tools for building Boost | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
gcc \ | ||
gfortran \ | ||
wget \ | ||
tar \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Define Boost version | ||
ENV BOOST_VERSION=1.87.0 | ||
ENV BOOST_DIR=boost_1_87_0 | ||
|
||
# Download and build Boost | ||
RUN wget https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_DIR}.tar.gz \ | ||
&& tar -xzf ${BOOST_DIR}.tar.gz \ | ||
&& cd ${BOOST_DIR} \ | ||
&& ./bootstrap.sh \ | ||
&& ./b2 install --prefix=/opt/boost --without-python cxxstd=17 link=shared runtime-link=shared | ||
|
||
# Stage 2: Final Image | ||
FROM ubuntu:22.04 | ||
|
||
# Install runtime dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
gcc \ | ||
gfortran \ | ||
cmake \ | ||
ninja-build \ | ||
git \ | ||
vim \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy Boost from the build stage | ||
COPY --from=build /opt/boost /opt/boost | ||
|
||
# Add Boost to environment variables | ||
ENV BOOST_ROOT=/opt/boost | ||
ENV LD_LIBRARY_PATH=/opt/boost/lib | ||
ENV PATH=/opt/boost/bin:$PATH | ||
|
||
# Add a non-root user for development | ||
RUN useradd -ms /bin/bash devuser | ||
USER devuser | ||
WORKDIR /home/devuser |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Recipe to build a Dev image for oneAPI 2024.2.1 with Boost 1.87.0 (custom-built) | ||
# Build with: | ||
# docker build -t aristos86/dev-ubuntu2204-boost1870-oneapi202421:latest -f Dockerfile.ubuntu.22.04-oneapi.2024.2.1 . | ||
# Run with: | ||
# docker run -it --rm -v $(pwd):/app aristos86/dev-ubuntu2204-boost1870-oneapi202421 /bin/bash | ||
|
||
# Stage 1: Build Boost | ||
FROM intel/hpckit:2024.2.1-0-devel-ubuntu22.04 AS build | ||
|
||
# Install essential tools for building Boost | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
gcc \ | ||
gfortran \ | ||
wget \ | ||
tar \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Define Boost version | ||
ENV BOOST_VERSION=1.87.0 | ||
ENV BOOST_DIR=boost_1_87_0 | ||
|
||
# Download and build Boost | ||
RUN wget https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_DIR}.tar.gz \ | ||
&& tar -xzf ${BOOST_DIR}.tar.gz \ | ||
&& cd ${BOOST_DIR} \ | ||
&& ./bootstrap.sh \ | ||
&& ./b2 install --prefix=/opt/boost --without-python cxxstd=17 link=shared runtime-link=shared | ||
|
||
|
||
|
||
|
||
# # Stage 2: Final Image | ||
# FROM intel/hpckit:2024.2.1-0-devel-ubuntu22.04 | ||
|
||
# # Install runtime dependencies | ||
# RUN apt-get update && apt-get install -y \ | ||
# build-essential \ | ||
# gcc \ | ||
# gfortran \ | ||
# cmake \ | ||
# ninja-build \ | ||
# git \ | ||
# vim \ | ||
# && apt-get clean \ | ||
# && rm -rf /var/lib/apt/lists/* | ||
|
||
# # Copy Boost from the build stage | ||
# COPY --from=build /opt/boost /opt/boost | ||
|
||
# # Add Boost to environment variables | ||
# ENV BOOST_ROOT=/opt/boost | ||
# ENV LD_LIBRARY_PATH=/opt/boost/lib | ||
# ENV PATH=/opt/boost/bin:$PATH | ||
|
||
# # Add a non-root user for development | ||
# RUN useradd -ms /bin/bash devuser | ||
# USER devuser | ||
# WORKDIR /home/devuser | ||
|
||
|
||
|