-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
50 lines (36 loc) · 1.23 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM ubuntu:xenial
LABEL maintainer="[email protected]"
WORKDIR /tmp/tower-installer
# update and install packages
RUN apt-get update -y \
&& apt-get install software-properties-common curl vim locales sudo apt-transport-https ca-certificates -y
# install ansible
RUN apt-add-repository ppa:ansible/ansible-2.7 \
&& apt-get update -y \
&& apt-get install ansible -y
# Set the locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# define tower version and PG_DATA
ENV TOWER_VERSION 3.4.1-1
ENV PG_DATA /var/lib/postgresql/9.6/main
# download tower installer
RUN curl -sSL http://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-${TOWER_VERSION}.tar.gz -o ansible-tower-setup-${TOWER_VERSION}.tar.gz \
&& tar xvf ansible-tower-setup-${TOWER_VERSION}.tar.gz \
&& rm -f ansible-tower-setup-${TOWER_VERSION}.tar.gz
# change working dir
WORKDIR /tmp/tower-installer/ansible-tower-setup-${TOWER_VERSION}
# create var folder
RUN mkdir /var/log/tower
# copy inventory
ADD inventory inventory
# install tower
RUN ./setup.sh
# add entrypoint script
ADD entrypoint.sh /entrypoint.sh
EXPOSE 80 443
# configure entrypoint
ENTRYPOINT [ "/bin/bash", "-c" ]
CMD [ "/entrypoint.sh" ]