An open API service indexing awesome lists of open source software.

https://github.com/vukanac/dynamic-docker-compose-base-image

Demo: Dynamicaly configure what base image version will be used for running a script (eg. Testing code agains multiple PHP versions)
https://github.com/vukanac/dynamic-docker-compose-base-image

Last synced: 2 months ago
JSON representation

Demo: Dynamicaly configure what base image version will be used for running a script (eg. Testing code agains multiple PHP versions)

Awesome Lists containing this project

README

        

# Dynamic base image

Pass ARG from Makefile trought docker-compose to Dockerfile.

```shell
$ make show PHP_VERSION=7.4 && make show PHP_VERSION=8.1
...
PHP 7.4.30 (cli) (built: Aug 23 2022 15:21:20) ( NTS )
...
PHP 8.1.9 (cli) (built: Aug 23 2022 13:59:34) (NTS)
...
```

## Docker build the latest version

```shell
$ make direct
docker build -t container_tag:latest --build-arg PHP_VERSION=latest .
...
docker run container_tag:latest php -v
PHP 8.1.9 (cli) (built: Aug 23 2022 13:59:34) (NTS)
...
```

## Docker build a specific version

```shell
$ make direct PHP_VERSION=7.4
docker build -t container_tag:latest --build-arg PHP_VERSION=latest .
...
docker run container_tag:7.4 php -v
PHP 7.4.30 (cli) (built: Aug 23 2022 15:21:20) ( NTS )
...
```