Skip to content

Commit

Permalink
allow customizing base image via build args
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed May 29, 2020
1 parent 6aa7927 commit 0027aa1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
10 changes: 8 additions & 2 deletions containers/Dockerfile.base-centos7
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM centos:7.8.2003
# Set default easybuild version
ARG IMG_REGISTRY=docker.io
ARG IMG_ORG=library
ARG IMG_NAME=centos
ARG IMG_TAG=7.8.2003
# allow CI/CD to change all of the above
FROM ${IMG_REGISTRY}/${IMG_ORG}/${IMG_NAME}:${IMG_TAG}
# set default easybuild version
ARG EB_VER=4.2.1
LABEL easybuild_version=${EB_VER}
# install required packages (EPEL is required for Lmod)
Expand Down Expand Up @@ -39,4 +44,5 @@ USER root
RUN pip3 uninstall -y easybuild
# switch to 'easybuild' user
USER easybuild
# make sure we start in /home/easybuild rather than / when shell in started in container
WORKDIR /home/easybuild
8 changes: 7 additions & 1 deletion containers/Dockerfile.centos7-GCC-9.3.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM easybuilders/base:centos7-eb4.2.1
ARG IMG_REGISTRY=docker.io
ARG IMG_ORG=easybuilders
ARG IMG_NAME=base
ARG IMG_TAG=centos7-eb4.2.1
# allow CI/CD to change all of the above
FROM ${IMG_REGISTRY}/${IMG_ORG}/${IMG_NAME}:${IMG_TAG}

# CPU_ARCH is expected to be defined in the "docker build" command,
# for example: docker build --build-arg CPU_ARCH=haswell
ARG CPU_ARCH
Expand Down
8 changes: 7 additions & 1 deletion containers/Dockerfile.centos7-foss2020a
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM easybuilders/test:centos7-eb421-gcc930
ARG IMG_REGISTRY=docker.io
ARG IMG_ORG=easybuilders
ARG IMG_NAME=test
ARG IMG_TAG=centos7-eb421-gcc930
# allow CI/CD to change all of the above
FROM ${IMG_REGISTRY}/${IMG_ORG}/${IMG_NAME}:${IMG_TAG}

# install software & accompanying modules
RUN (eb foss-2020a.eb --robot || tail -100 `eb --last-log`) \
# clean up everything in /scratch
Expand Down

0 comments on commit 0027aa1

Please sign in to comment.