Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ng): manage container capabilities in ng state #308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docker/compose/ng.sls
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ docker-compose-ng-{{ id }}-running:
- {{ variable }}: {{ value }}
{%- endfor %}
{%- endif %}
{%- if 'cap_drop' in container and container.cap_drop is iterable %}
- cap_drop:
{%- for cap in container.cap_drop %}
- {{ cap }}
{%- endfor %}
{%- endif %}
{%- if 'cap_add' in container and container.cap_add is iterable %}
- cap_add:
{%- for cap in container.cap_add %}
- {{ cap }}
{%- endfor %}
{%- endif %}
{%- if 'ports' in container and container.ports is iterable %}
- port_bindings:
{%- for port_mapping in container.ports %}
Expand Down
5 changes: 5 additions & 0 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ To use this formula, you might target a host with the following pillar:
STORAGE_PATH: *datapath
SEARCH_BACKEND: 'sqlalchemy'
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: '/registry'
cap_add:
- ALL
cap_drop:
- NET_ADMIN
- SYS_ADMIN
ports:
- 127.0.0.1:5000:5000
# restart: 'always' # compose v1.9
Expand Down
5 changes: 5 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ docker:
STORAGE_PATH: *datapath
SEARCH_BACKEND: 'sqlalchemy'
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: '/registry'
cap_add:
- ALL
cap_drop:
- NET_ADMIN
- SYS_ADMIN
ports:
- 127.0.0.1:5000:5000
# restart: 'always' # compose v1.9
Expand Down