Skip to content
This repository has been archived by the owner on Sep 25, 2022. It is now read-only.

Commit

Permalink
bionic
Browse files Browse the repository at this point in the history
  • Loading branch information
jbigot committed Dec 6, 2021
1 parent e9dbcf9 commit e5b8a84
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,31 @@ defaults:
env:
MAKEFLAGS: -j 4
jobs:
build_bionic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: detect current version
run: |
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]
then
BRANCH_NAME="${GITHUB_HEAD_REF}"
else
BRANCH_NAME="${GITHUB_REF/*\/}"
fi
echo "BRANCH_NAME=${BRANCH_NAME}"
set +e
if echo "${BRANCH_NAME}" | grep -qs '^v[0-9]*$' &> /dev/null
then
image_version="$(echo "${BRANCH_NAME}" | sed 's%^v\([0-9]*\)$%\1%')"
else
image_version="$(( 0$(git branch -r --merged | grep '^\s*origin/v[0-9]*\s*$' | sed 's%^\s*origin/v\([0-9]*\)\s*$%\1%' | sort -nu | head -n 1 ) +1 ))"
fi
echo "image_version=${image_version}"
echo "image_version=v${image_version}" >> $GITHUB_ENV
- name: build bionic
run: |
docker build -t pdidevel/bionic -t pdidevel/bionic:${image_version} bionic
build_xenial:
runs-on: ubuntu-latest
steps:
Expand Down
62 changes: 62 additions & 0 deletions bionic/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM ubuntu:18.04

ENV DOCKERFILE_BASE=ubuntu \
DOCKERFILE_DISTRO=ubuntu \
DOCKERFILE_DISTRO_VERSION=18.04 \
SPACK_ROOT=/opt/spack \
DEBIAN_FRONTEND=noninteractive \
CURRENTLY_BUILDING_DOCKER_IMAGE=1 \
container=docker

ENV SPACK_ROOT=/opt/spack

ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

RUN set -ex \
&& apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
file \
g++ \
gcc \
gfortran \
git \
gnupg2 \
iproute2 \
locales \
make \
python3 \
python3-pip \
python3-setuptools \
tcl \
unzip \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/* \
&& locale-gen ${LC_ALL} \
&& pip3 --no-cache-dir install boto3 \
&& mkdir -p ${SPACK_ROOT} \
&& git clone https://github.com/spack/spack.git ${SPACK_ROOT} \
&& ln -s ${SPACK_ROOT}/share/spack/docker/entrypoint.bash /usr/local/bin/docker-shell \
&& ln -s ${SPACK_ROOT}/share/spack/docker/entrypoint.bash /usr/local/bin/interactive-shell \
&& ln -s ${SPACK_ROOT}/share/spack/docker/entrypoint.bash /usr/local/bin/spack-env \
&& mkdir -p /root/.spack \
&& cp ${SPACK_ROOT}/share/spack/docker/modules.yaml /root/.spack/modules.yaml \
&& rm -rf /root/*.* /run/nologin ${SPACK_ROOT}/.git \
&& [ -f ~/.profile ] && ( sed -i 's/mesg n/( tty -s \&\& mesg n || true )/g' ~/.profile || true ) \
&& spack bootstrap untrust spack-install \
&& spack spec hdf5+mpi

WORKDIR /root
SHELL ["docker-shell"]

# TODO: add a command to Spack that (re)creates the package cache

ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"]
CMD ["interactive-shell"]

0 comments on commit e5b8a84

Please sign in to comment.