-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stingus
committed
Jan 30, 2018
0 parents
commit 68726aa
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM alpine | ||
|
||
VOLUME ["/project"] | ||
|
||
WORKDIR "/project" | ||
|
||
RUN apk add --no-cache python3 \ | ||
&& python3 -m ensurepip \ | ||
&& rm -r /usr/lib/python*/ensurepip \ | ||
&& pip3 install --upgrade pip setuptools \ | ||
&& ln -s pip3 /usr/bin/pip \ | ||
&& ln -sf /usr/bin/python3 /usr/bin/python \ | ||
&& apk add --no-cache --virtual .build-deps \ | ||
g++ \ | ||
make \ | ||
python3-dev \ | ||
libffi-dev \ | ||
openssl-dev \ | ||
&& pip install ansible==2.4.2 \ | ||
&& apk del .build-deps \ | ||
&& rm -r /root/.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Ansible Docker image | ||
|
||
This Docker image is based on Alpine and Python3 and provides the Ansible executable. | ||
Check the repo tags for the available Ansible versions. | ||
|
||
## Usage | ||
|
||
```bash | ||
$ docker run --rm stingus/ansible -v <your_ansible_project_path>:/project | ||
``` | ||
This will start a Docker container with your Ansible project mounted in `/project`. | ||
|
||
### Running a playbook | ||
It's recommended to keep your inventory in the project thus not to rely on /etc/ansible/hosts. | ||
|
||
```bash | ||
$ ansible-playbook -i hosts your_playbook.yml | ||
``` | ||
|
||
## LICENSE | ||
|
||
MIT |