Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 26, 2020

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.

@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 👌

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