Skip to content

Commit

Permalink
Allow docker command to be null or empty, set default CMD in dockerfi…
Browse files Browse the repository at this point in the history
…le instead

Signed-off-by: Fabian von Feilitzsch <[email protected]>
  • Loading branch information
fabianvf committed Dec 10, 2018
1 parent 467cb2b commit 75f9064
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y pyth
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
{%- endraw %}

CMD ["sh", "-c", "while true; do sleep 10000; done"]
1 change: 1 addition & 0 deletions molecule/model/schema_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ def pre_validate_base_schema(env, keep_string):
},
'command': {
'type': 'string',
'nullable': True,
},
'privileged': {
'type': 'boolean',
Expand Down
2 changes: 1 addition & 1 deletion molecule/provisioner/ansible/playbooks/docker/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
state: started
recreate: false
log_driver: json-file
command: "{{ item.command | default('bash -c \"while true; do sleep 10000; done\"') }}"
command: "{{ item.command | default(omit) }}"
privileged: "{{ item.privileged | default(omit) }}"
security_opts: "{{ item.security_opts | default(omit) }}"
volumes: "{{ item.volumes | default(omit) }}"
Expand Down

0 comments on commit 75f9064

Please sign in to comment.