Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

How to run multiple "commands" after container is started #915

Open
binithlighting opened this issue Apr 9, 2018 · 2 comments
Open

How to run multiple "commands" after container is started #915

binithlighting opened this issue Apr 9, 2018 · 2 comments
Labels
question stale-communication Candidate for the closure due to stale communication

Comments

@binithlighting
Copy link

ISSUE TYPE
  • Documentation Report
container.yml
settings:
  conductor_base: ubuntu:16.04

services:

  hse25.0_rc1_85_2105:
    roles:
     - hse25.0_rc1_85_2105
    ports:
     - "8025:80"
     - "2105:2100/udp"
     - "44325:443"
     - "8425:8843"
    command: ["/bin/sh", "-c", "/root/hse/hse.sh -test" , "-test", "mystate"]
    command: ["/bin/sh", "-c", "echo" , "hellow"]
OS / ENVIRONMENT

Ansible Container, version 0.9.2
Linux, dockerbox-1, 4.13.0-32-generic, #35~16.04.1-Ubuntu SMP Thu Jan 25 10:13:43 UTC 2018, x86_64
2.7.12 (default, Nov 20 2017, 18:23:56)

##### SUMMARY
I am not able to figureout how to run an additional command after the container has started.
I think the way described in the container.yml(pasted above) is wrong, as it contains two "command" directives.

To be specific, I am looking for something like a "post-container-start" directive, or a way to run multiple commands. Ofcourse an option is to put all the required commands in a single shell script, but just wondering if there is another way.

##### STEPS TO REPRODUCE
Add a seconds command directive in container.yml

##### EXPECTED RESULTS
Run two (or more) commands, one after the other

##### ACTUAL RESULTS

Container wont start
@re-mscho
Copy link

Untested but I guess it works here too: docker-library/redmine#52 (comment)

@Voronenko
Copy link
Contributor

@binithlighting Did you try advise by @re-mscho ?

@Voronenko Voronenko added stale-communication Candidate for the closure due to stale communication question and removed help wanted labels Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question stale-communication Candidate for the closure due to stale communication
Projects
None yet
Development

No branches or pull requests

3 participants