https://github.com/moshloop/docker-systemd-service
https://github.com/moshloop/docker-systemd-service
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/moshloop/docker-systemd-service
- Owner: moshloop
- Created: 2018-07-10T08:31:19.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-30T18:34:46.000Z (almost 8 years ago)
- Last Synced: 2024-12-28T20:26:30.611Z (over 1 year ago)
- Language: Shell
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## moshloop.systemd_docker_service
[](https://travis-ci.org/moshloop/ansible-docker-systemd-service)
An ansible role that runs a container using docker as a systemd service
### Container Arguments
| Argument | Default | Description |
| -------------- | -------------------- | ----------- |
| **image** | [Required] | Docker image to run |
| **service** | [Required] | The name of the systemd service |
| env | | A dictionary of environment variables to pass through |
| docker_args | | Additional arguments to the docker client e.g. `-p 8080:8080` |
| docker_opts | | Additional options to the docker client e.g. `-H unix:///tmp/var/run/docker.sock` |
| args | | Additional arguments to the container |
| volumes | | |
| ports | | |
| links | | |
### Example
```yaml
---
- hosts: localhost
roles:
- moshloop.systemd
tasks:
- include_role: name=moshloop.docker_systemd_service
vars:
containers:
- image: nginx
service: nginx
env:
DOMAIN: localhost.com
- image: nginx
service: nginx2
docker_args: -p 8080:80
```