Skip to content

Add Docker Bake module #1058

Open
Open
@peanutsguy

Description

@peanutsguy
SUMMARY

On Feb 5, 2025, Docker released Docker Bake, which simplifies image building. It would be great if we could apply a docker-bake.hcl file with Ansible.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

docker_image_bake
docker_bake

ADDITIONAL INFORMATION

Documentation

- name: Run 'docker buildx bake'
  community.docker.docker_bake:
    files:
      - mybakefile.hcl
      - myoverridefile.hcl
    targets:
      - webapp
      - db
    set:
      - *.tags.version=v1
      - *.platform=linux/arm64
    variables:
      - PORT=7000

This example would be akin to running

PORT=7000 docker buildx bake -f mybakefile.hcl -f myoverridefile.hcl --set *.tags.version=v1 --set *.platform=linux/arm64 webapp db

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions