File tree Expand file tree Collapse file tree 2 files changed +113
-0
lines changed Expand file tree Collapse file tree 2 files changed +113
-0
lines changed Original file line number Diff line number Diff line change 1+ # Docker image: Ansible
2+
3+ [ ![ Docker Hub] ( https://img.shields.io/badge/docker-ansible-blue.svg )] ( https://hub.docker.com/r/chusiang/ansible/ )
4+
5+ A Docker image for run the [ Ansible] [ ansible_official ] v2.3.1.
6+
7+ [ ansible_official ] : https://www.ansible.com/
8+
9+ ## Supported tags and respective ` Dockerfile ` links
10+
11+ - ` alpine-3.6 ` , ` latest ` [ * (Dockerfile)* ] [ dockerfile_alpine-3.6 ]
12+
13+ [ dockerfile_alpine-3.6 ] : alpine-3.6/Dockerfile
14+
15+
16+
17+ ## Build image
18+
19+ 1 . Get this project.
20+
21+ ```
22+ $ git clone https://github.com/chusiang/ansible.dockerfile.git
23+ ```
24+
25+ 1. Go to workspace.
26+
27+ ```
28+ $ cd ansible.dockerfile/alpine-3.6
29+ ```
30+
31+ 1. Bunild the image.
32+
33+ ```
34+ $ docker build -t ansible .
35+ $ docker build -t ansible:alpine-3.6 .
36+ ```
37+
38+ ## Run container
39+
40+ 1. Get image.
41+
42+ ```
43+ $ docker pull chusiang/ansible
44+ ```
45+
46+ 1. Run the container.
47+
48+ ```
49+ $ docker run --name ansible -it chusiang/ansible sh
50+ ```
51+
52+ 1. Check container process.
53+
54+ ```
55+ $ docker ps
56+ ```
57+
58+ 1. Enter container with command line.
59+
60+ ```
61+ $ docker exec -it ansible bash
62+ ```
63+
64+ Enjoy it !
65+
66+ ## License
67+
68+ MIT license from 2017.
69+
70+ ## Author Information
71+
72+ 1. [Chu-Siang Lai](https://github.com/chusiang/)
Original file line number Diff line number Diff line change 1+ FROM alpine:3.6
2+
3+ MAINTAINER Chu-Siang Lai <
[email protected] >
4+
5+ # Update the index of available packages.
6+ RUN apk update
7+
8+ # Install the requires apk package and python.
9+ RUN apk add --no-cache build-base python py-pip python-dev \
10+ libffi-dev openssl-dev
11+
12+ # Upgrade the pip to lastest.
13+ RUN pip install -U pip cffi
14+
15+ # Setup the ansible.
16+ RUN pip install ansible
17+
18+ # for disable localhost warning message.
19+ RUN mkdir /etc/ansible && \
20+ /bin/echo -e "[local]\n localhost ansible_connection=local" > /etc/ansible/hosts
21+
22+ RUN echo "===> Install some package for Latticework Inc...." && \
23+ apk add --update --no-cache \
24+ bash \
25+ bash-completion \
26+ curl \
27+ git \
28+ make \
29+ sshpass \
30+ vim
31+
32+ RUN echo "===> Removing package cache..." && \
33+ apk del build-dependencies ;\
34+ rm -rf /var/cache/apk/*
35+
36+ ONBUILD RUN echo "===> Updating TLS certificates..." && \
37+ apk add --update openssl ca-certificates
38+
39+ WORKDIR /srv
40+
41+ CMD [ "ansible-playbook" , "--version" ]
You can’t perform that action at this time.
0 commit comments