Skip to content

Commit a772c34

Browse files
committed
Refactor for support multiple ansible reversion
I will only build this image with alpine linux if you need other os resource, maybe you can see other repo. 1. https://hub.docker.com/r/chusiang/ansible-jupyter/ 2. https://hub.docker.com/r/williamyeh/ansible/
1 parent 12691fd commit a772c34

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
# Docker image: Ansible
22

3-
[![Docker Hub](https://img.shields.io/badge/docker-ansible-blue.svg)](https://hub.docker.com/r/chusiang/ansible/)
3+
[![Docker Hub](https://img.shields.io/badge/docker-ansible-blue.svg)](https://hub.docker.com/r/chusiang/ansible/) [![Docker Hub](https://img.shields.io/badge/os-alpine-blue.svg)](https://hub.docker.com/_/alpine/)
44

5-
A Docker image for run the [Ansible][ansible_official] v2.3.1.
5+
A Docker image for run the [Ansible][ansible_official] Engine on Alpine Linux.
66

77
[ansible_official]: https://www.ansible.com/
88

99
## Supported tags and respective `Dockerfile` links
1010

11-
- `alpine-3.6`, `latest` [*(Dockerfile)*][dockerfile_alpine-3.6]
12-
13-
[dockerfile_alpine-3.6]: alpine-3.6/Dockerfile
14-
15-
11+
- `2.3`, `latest` [*(Dockerfile)*](v2.3/Dockerfile)
1612

1713
## Build image
1814

@@ -25,14 +21,14 @@ A Docker image for run the [Ansible][ansible_official] v2.3.1.
2521
1. Go to workspace.
2622
2723
```
28-
$ cd ansible.dockerfile/alpine-3.6
24+
$ cd ansible.dockerfile/<REVERSION>
2925
```
3026
3127
1. Bunild the image.
3228
3329
```
3430
$ docker build -t ansible .
35-
$ docker build -t ansible:alpine-3.6 .
31+
$ docker build -t ansible:<REVERSION> .
3632
```
3733
3834
## Run container
@@ -65,7 +61,7 @@ Enjoy it !
6561
6662
## License
6763
68-
MIT license from 2017.
64+
MIT license from 2017-2018.
6965
7066
## Author Information
7167

alpine-3.6/Dockerfile renamed to v2.3/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ RUN apk add --no-cache build-base python py-pip python-dev \
1313
RUN pip install -U pip cffi
1414

1515
# Setup the ansible.
16-
RUN pip install ansible
16+
RUN pip install 'ansible>=2.3.0,<2.4.0'
1717

1818
# for disable localhost warning message.
1919
RUN mkdir /etc/ansible && \
2020
/bin/echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
2121

22-
RUN echo "===> Install some package for Latticework Inc...." && \
22+
RUN echo "===> Install some package ..." && \
2323
apk add --update --no-cache \
2424
bash \
2525
bash-completion \
@@ -30,11 +30,12 @@ RUN echo "===> Install some package for Latticework Inc...." && \
3030
sshpass \
3131
vim
3232

33-
RUN echo "===> Removing package cache..." && \
34-
apk del build-dependencies ;\
35-
rm -rf /var/cache/apk/*
33+
RUN echo "===> Removing package cache ..." && \
34+
apk del build-dependencies ; \
35+
rm -rf /var/cache/apk/* && \
36+
rm -rf ~/.cache/pip
3637

37-
ONBUILD RUN echo "===> Updating TLS certificates..." && \
38+
ONBUILD RUN echo "===> Updating TLS certificates ..." && \
3839
apk add --update openssl ca-certificates
3940

4041
WORKDIR /srv

0 commit comments

Comments
 (0)