Skip to content

allow more/all Docker build options #3466

@huanjani

Description

@huanjani

Docker has many options to use with docker build: https://docs.docker.com/engine/reference/commandline/build/#options.
Copilot currently supports only a handful of these flags under image.build:

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

Copilot users are interested in leveraging other options, for instance, this user, who wants to use --no-cache.
Users could have much more control over their builds if we just injected all key-value pairs as flag-value pairs when running the docker build command. We would have to figure out how to handle flags that don't require values, as well as whether to prohibit any incompatible flags/validate in some way.

Benefits are that users have more flexibility and that Copilot maintainers don't have to keep up with Docker's options.
One drawback is an increased possibility of build failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/deploymentIssues related to deploymentstype/enhancementIssues that are improvements for existing features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions