Skip to content

Commit

Permalink
#110: Add Darwin-incompatible options to the container creation on ot…
Browse files Browse the repository at this point in the history
…her distros
  • Loading branch information
BR0kEN- committed Mar 19, 2018
1 parent 2713286 commit fb4480c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions env/start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- name: Define the hostname
set_fact:
hostname: "{{ site_url.split('//') | last }}"
options: ""
mounts: ""
ports: ""

Expand Down
19 changes: 14 additions & 5 deletions env/tasks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,26 @@
{{ ports }} -p {{ item }}
with_items: "{{ vm.ports }}"

- name: Determine OS family
shell: uname
register: uname

- name: Define the options
set_fact:
options: >
-v /sys/fs/cgroup:/sys/fs/cgroup:ro
--tmpfs /run
--tmpfs /run/lock
--security-opt seccomp=unconfined
when: "'Darwin' != uname.stdout"

- name: Create the container
# @todo These options aren't working on macOS.
# -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
# --tmpfs /run \
# --tmpfs /run/lock \
# --security-opt seccomp=unconfined \
shell: |-
docker run \
-d \
-h '{{ hostname }}' \
--name '{{ hostname }}' \
{{ options }} \
{{ mounts }} \
{{ ports }} \
solita/ubuntu-systemd
Expand Down

0 comments on commit fb4480c

Please sign in to comment.