Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
title.env example
USER_ID=1000
GROUP_ID=1000
ALMA_DIR=/external/docker
REPO_DIR=/external/Repos
CONTAINER_OS=centos7

Makefile

Code Block
titleMakefile
images:=$(wildcard fedora*) $(wildcard centos*)
build: $(images)
.PHONY: $(images)
$(images):
        @CONTAINER_OS=$@ docker-compose build $@
$(addprefix up-,$(images)):
        @CONTAINER_OS=$(subst up-,,$@) docker-compose up $(subst up-,,$@)

$(addprefix down-,$(images)):
        @CONTAINER_OS=$(subst down-,,$@) docker-compose down


Code Block
languagebash
titleExample
make centos7


Example directory tree

Code Block
.
├── centos6
│   ├── Dockerfile
│   └── working
│       ├── acs.env
│       ├── buildExtProds.sh
│       └── working
│           ├── acs.env
│           ├── buildACS.sh
│           ├── buildALMASW.sh
│           ├── buildCommon.sh
│           └── buildExtProds.sh
├── centos7
│   ├── Dockerfile
│   └── working
│       ├── acs.env
│       ├── buildACS.sh
│       ├── buildALMASW.sh
│       ├── buildCommon.sh
│       └── buildExtProds.sh
├── centos8
│   ├── Dockerfile
│   └── working
│       └── working
│           ├── acs.env
│           ├── buildACS.sh
│           ├── buildALMASW.sh
│           ├── buildCommon.sh
│           └── buildExtProds.sh
├── docker-compose.yml
├── .env
└── Makefile

Execution

Code Block
titleBash
#Executing centos7
docker-compose run centos7 bash
#Executing centos6 requires to define the CONTAINER_OS variable
CONTAINER_OS=centos6 docker-compose run centos7 bash