Hi,

I assume that running "dnf install -y make gcc openssl-devel
libxml2-devel lz4-devel libzstd-devel bzip2-devel" is done after ~90
seconds.

You are asking for that command to be run in a container, once that
command finishes, the container exists. That's how Docker works, and it
would behave exactly the same as the module if you start a detached
container from the Docker CLI.

If you want the container to keep existing, you need to use a command
that does not exit.

Basically what you ask the module to do is equivalent to running

  docker run --detach --interactive --tty --workdir /build \
     -v /data/build/:/build --name pgBackRestBuilder \
     docker.io/rockylinux:8 dnf install -y make gcc openssl-devel \
     libxml2-devel lz4-devel libzstd-devel bzip2-devel

on the command line.

Cheers,
Felix



> I want to create a docker container on a remote host and then, in a
> second step build a binary for pgBackRest inside that container. It
> fails with the task to create the container, install some packages
> for the build and then remain to run. 
> - name: creating a build-container
> docker_container:name: pgBackRestBuilder
> image: docker.io/rockylinux:8
> volumes:
> - /data/build/:/build
> state: started
> restart: true
> detach: true
> tty: true
> interactive: true
> working_dir: /build
> command: dnf install -y make gcc openssl-devel libxml2-devel
> lz4-devel libzstd-devel bzip2-devel become: true
>  
>  
> What happens is that the container is being spun up, running for
> about 90 seconds and then shutting down without (as far as I can
> tell) having installed i.e. make. I was thinking the detach, tty &
> interactive options should have made the container to last. any hint,
> what I am doing wrong here?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20220711213539.4db75a93%40rovaniemi.

Reply via email to