Mounting local/host volume while installing through docker-compose

193 views
Skip to first unread message

Nithin V Gopal

unread,
Dec 22, 2020, 3:30:58 AM12/22/20
to AWX Project
Hi,

I am new to AWX world probably this query might be a duplicate.

I have installed AWX using docker-compose and running a job which has two steps
- Execute the script in remote
- Copy the output back to host /tmp folder

The script is successfully getting executed where as the copy task is copying the output to containers' /tmp not the host.

Can someone point on how to mount local directory when launching the AWX through docker-compose?

I tried changing the docker-compose file, it doesn't work as the installer re-writes the docker-compose.yaml when re-installing. 

phil.gr...@gmail.com

unread,
Dec 23, 2020, 5:15:39 AM12/23/20
to AWX Project
This may not be the right way, but I suggest you look at using a bind mount - https://docs.docker.com/storage/bind-mounts/

Abhinit Mallick

unread,
Jan 6, 2021, 9:15:31 AM1/6/21
to AWX Project
Hi Nithin,

Greetings of the day

I have a similar requirement ,My requirement is that I must be able to mount a remote mount in awx, the way we are running awx is standalone docker images
This what I did to make things work in normal environment

So when awx is installed in a normal estate all it does is within the {{awx git repo clone}}/installer/roles/local_docker/templates/docker-compose.yml.j2
and from that it creates /root/.awx/awxcompose/docker-compose.yml

All I had to do was edit  /root/.awx/awxcompose/docker-compose.yml  to mount the volume ( this is the same place where you can use custom images as well) 

The only bad side of such a setup is everyime I upgrade my awx instance I will need to manually change the file to add the remote mount.

Regards
Abhinit Mallick
Reply all
Reply to author
Forward
0 new messages