Skip to content

Commit

Permalink
feat: Build options
Browse files Browse the repository at this point in the history
  • Loading branch information
leocavalcante committed Dec 12, 2023
1 parent a3faae3 commit f2daae1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ For example:
PHP_VERSION=83
```

### Docker arguments
### Docker behaviour

#### Run options

You can also provide any additional [Docker `run` arguments](https://docs.docker.com/engine/reference/commandline/run/#options) using the `args` variable.

Expand All @@ -87,6 +89,13 @@ you can add the following to your `.phpctlrc` file:
args=(-p 9501:9501)
```

#### Build options

You can also provide [build options](https://docs.docker.com/engine/reference/commandline/build/) to the build command using the `build` variable:
```shell
build=(--build-arg APP_ENV=dev --label phprocks)
```

## Modules
<details>
<summary>For the default Docker image we have the following modules installed (click to expand).</summary>
Expand Down
5 changes: 4 additions & 1 deletion src/docker.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
build() {
docker build --build-arg PHP="$PHP_VERSION" --build-arg COMPOSER_AUTH="$COMPOSER_AUTH" -t "$PHPCTL_IMAGE" .
docker build \
--build-arg PHP="$PHP_VERSION" \
--build-arg COMPOSER_AUTH="$COMPOSER_AUTH" \
${build[@]} -t "$PHPCTL_IMAGE" .
}

push() {
Expand Down

0 comments on commit f2daae1

Please sign in to comment.