community.docker icon indicating copy to clipboard operation
community.docker copied to clipboard

Add Docker Bake module

Open peanutsguy opened this issue 1 year ago • 0 comments

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

peanutsguy avatar Mar 14 '25 16:03 peanutsguy