Skip to content

feat(manifest): Add target and cache from build options#1555

Merged
mergify[bot] merged 2 commits intoaws:mainlinefrom
mRoca:feat/build-options
Oct 26, 2020
Merged

feat(manifest): Add target and cache from build options#1555
mergify[bot] merged 2 commits intoaws:mainlinefrom
mRoca:feat/build-options

Conversation

@mRoca
Copy link
Contributor

@mRoca mRoca commented Oct 22, 2020

This PR allows to specify the --target and --cache-from docker build options with a docker-compose like syntaxe

image:
  build:
    dockerfile: path/to/dockerfile
    context: context/dir
    target: build-stage
    cache_from:
      - image:tag
    args:
      key: value

The cache_from option allows to pull a previously built image and use it as cache layers, and the target option allows... well, to use a multi-stages Dockerfile.

Resolves #1331

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mRoca mRoca requested a review from a team as a code owner October 22, 2020 22:38
@mRoca mRoca requested a review from efekarakus October 22, 2020 22:38
@mRoca mRoca force-pushed the feat/build-options branch from 08dba73 to c38908d Compare October 22, 2020 22:40
@efekarakus
Copy link
Contributor

This is awesome thanks @mRoca ! it also resolves #1331

Copy link
Contributor

@efekarakus efekarakus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! Only small text recommendations but otherwise the code looks great 👌

@mRoca mRoca force-pushed the feat/build-options branch from c38908d to ae81915 Compare October 24, 2020 08:55
@mRoca mRoca force-pushed the feat/build-options branch from ae81915 to 726ee20 Compare October 24, 2020 08:59
Copy link
Contributor

@efekarakus efekarakus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you!

Copy link
Contributor

@bvtujo bvtujo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome, thank you so much for the contribution!

@mergify mergify bot merged commit 043f1f1 into aws:mainline Oct 26, 2020
@mRoca mRoca deleted the feat/build-options branch October 27, 2020 09:55
thrau pushed a commit to localstack/copilot-cli-local that referenced this pull request Dec 9, 2022
This PR allows to specify the `--target` and `--cache-from` docker build options with a [docker-compose](https://docs.docker.com/compose/compose-file/#cache_from) like syntaxe

```yaml
image:
  build:
    dockerfile: path/to/dockerfile
    context: context/dir
    target: build-stage
    cache_from:
      - image:tag
    args:
      key: value
```

The `cache_from` option allows to pull a previously built image and use it as cache layers, and the `target` option allows... well, to use a multi-stages Dockerfile.

Resolves aws#1331


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multi-stage build targets

3 participants