Skip to content
This repository was archived by the owner on Jun 22, 2026. It is now read-only.

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

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

mergify[bot] merged 2 commits into
aws:mainlinefrom
mRoca:feat/build-options

Conversation

@mRoca

@mRoca mRoca commented Oct 22, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@efekarakus efekarakus left a comment

Copy link
Copy Markdown
Contributor

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 👌

Comment thread internal/pkg/docker/docker_test.go Outdated
Comment thread internal/pkg/manifest/workload.go Outdated
Comment thread internal/pkg/manifest/workload_test.go
Comment thread site/content/docs/manifest/lb-web-service.md
Comment thread templates/cicd/buildspec.yml
Comment thread templates/workloads/jobs/scheduled-job/manifest.yml Outdated
@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

@efekarakus efekarakus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome, thank you!

@bvtujo bvtujo left a comment

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multi-stage build targets

4 participants