I would like to build a container then run some commands on it...
- name: Log into DockerHub
docker_login:
username: "{{docker_hub_username}}"
password: "{{docker_hub_password}}"
email: "{{docker_hub_email}}"
- name: Build Foo Container
docker:
name: foo
image: gobaltoops/foo:{{ git_hash_short }}
state: reloaded
pull: always
command: bash "{{ app_root }}"/"{{ config_path }}"/"{{ app_env
}}"/wrapper.sh
volumes:
- "{{ foo_base_dir }}/templates:/templates"
- "{{ foo_base_dir}}/logs:{{ app_root }}/logs"
- "{{ foo_base_dir }}/target:{{ app_root }}/output"
env:
APP_ROOT: "{{ app_root }}"
I would then like to run after:
docker exec -t foo config arg1
docker exec -t foo migrate source
docker exec -t foo build $GIT_HASH_SHORT
I tried this, but it didn't work:
- hosts: foo
connection: docker
tasks:
- command: config arg1
- command: migrate source
- command: build {{ git_hash_short }}
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/e006657b-fd8c-4998-9782-98f2034ff1f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.