Skip to content

Commit

Permalink
docker: Add --platform option to docker run command (#3615)
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroon-Khel authored Jun 27, 2024
1 parent 810b20c commit ce034c0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
- name: Set docker build command
set_fact:
docker_build_command: "docker build"
docker_run_command: "docker run"
arm32_suffix: ""

- name: Set docker buildx command if building arm32 container
set_fact:
docker_build_command: "docker buildx build --platform linux/v7/arm"
arm32_suffix: ".ARM32"
ansible_architecture: arm
docker_run_command: "docker run --platform linux/v7/arm"
when: build_arm32 is defined and build_arm32 == "yes"

# Dockerfiles are transferred from the controller node onto the dockerhost to be used to build and run docker containers
Expand Down Expand Up @@ -51,4 +53,4 @@
when: not (docker_port_output.stdout == "")

- name: Run {{ docker_image }} docker container
command: docker run --restart unless-stopped -p {{ docker_port }}:22 --cpuset-cpus="0-3" --memory=6G --detach --name {{ docker_image | upper }}.{{ docker_port }}{{ arm32_suffix }} aqa_{{ docker_image }}{{ arm32_suffix }}
command: "{{ docker_run_command }} --restart unless-stopped -p {{ docker_port }}:22 --cpuset-cpus='0-3' --memory=6G --detach --name {{ docker_image | upper }}.{{ docker_port }}{{ arm32_suffix }} aqa_{{ docker_image }}{{ arm32_suffix }}"

0 comments on commit ce034c0

Please sign in to comment.