-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·83 lines (57 loc) · 2.28 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM ubuntu:16.04
LABEL maintainer="AXErunners <info@axerunners.com>"
LABEL description="AxeDrive Node.JS"
# Install build utils
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
python-minimal \
python-pip \
git
# Add apt repositories
RUN curl -s https://swupdate.openvpn.net/repos/repo-public.gpg|apt-key add - && \
echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 && \
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" > /etc/apt/sources.list.d/ansible.list && \
curl -sL https://deb.nodesource.com/setup_8.x | bash -
# Install dependencies from apt repos
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ansible \
openvpn \
nodejs
# Install terraform
ARG TERRAFORM_VERSION=0.11.11
RUN curl -O https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/bin && \
rm terraform_${TERRAFORM_VERSION}_linux_amd64.zip
# Install Docker client
ENV DOCKERVERSION=18.06.2-ce
RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \
&& tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 \
-C /usr/local/bin docker/docker \
&& rm docker-${DOCKERVERSION}.tgz
# Copy axe-cli form axed image
COPY --from=axerunners/axed:latest /usr/local/bin/axe-cli /usr/local/bin
# Copy sources
WORKDIR /usr/src/app
COPY . .
# Install ansible playbook and Node.JS dependencies
RUN pip install --upgrade netaddr awscli paramiko Crypto && \
ansible-galaxy install -r ansible/requirements.yml && \
npm install
# Remove build utils
RUN apt-get remove --purge -y \
python-pip \
unzip \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Create networks shortcut
RUN ln -s /usr/src/app/networks /networks
VOLUME ["/networks"]
VOLUME ["/usr/src/app/terraform/aws/.terraform"]
ENTRYPOINT ["/usr/src/app/docker/entrypoint.sh"]
CMD ["deploy", "--help"]