-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathDockerfile.tests
109 lines (91 loc) · 3.67 KB
/
Dockerfile.tests
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
FROM python:3.12-slim
WORKDIR /
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install --assume-yes \
curl unzip git wget zip git \
pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl xmlsec1 libgraphviz-dev libmagic1 \
gcc g++ libffi-dev python3-gpg && \
apt-get clean all
RUN bash -c 'if [ "$(uname -m)" == "aarch64" ]; \
then \
arch=arm64; \
else \
arch=amd64; \
fi; \
wget https://github.com/terraform-docs/terraform-docs/releases/download/v0.19.0/terraform-docs-v0.19.0-linux-${arch}.tar.gz && tar -zxvf terraform-docs-v0.19.0-linux-${arch}.tar.gz && chmod +x terraform-docs && mv terraform-docs /usr/local/bin/ && rm terraform-docs-v0.19.0-linux-${arch}.tar.gz'
RUN bash -c 'if [ "$(uname -m)" == "aarch64" ]; \
then \
arch=arm64; \
else \
arch=amd64; \
fi; \
wget https://github.com/aquasecurity/tfsec/releases/download/v1.28.4/tfsec-linux-${arch} -O /usr/local/bin/tfsec && \
chmod +x /usr/local/bin/tfsec'
# Download Infracost
RUN bash -c 'if [ "$(uname -m)" == "aarch64" ]; \
then \
arch=arm64; \
else \
arch=amd64; \
fi; \
wget https://github.com/infracost/infracost/releases/download/v0.10.22/infracost-linux-${arch}.tar.gz -O /tmp/infracost.tar.gz && \
tar -zxvf /tmp/infracost.tar.gz infracost-linux-${arch} && \
mv infracost-linux-${arch} /usr/local/bin/infracost && \
chmod +x /usr/local/bin/infracost && \
rm /tmp/infracost.tar.gz'
# Download tfswitch
RUN bash -c 'curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/master/install.sh | bash /dev/stdin 1.2.2'
# Install go
RUN bash -c 'if [ "$(uname -m)" == "aarch64" ]; \
then \
arch=arm64; \
else \
arch=amd64; \
fi; \
wget https://go.dev/dl/go1.20.10.linux-${arch}.tar.gz -O /tmp/go.tar.gz && \
tar -zxvf /tmp/go.tar.gz -C /usr/local && \
rm /tmp/go.tar.gz'
ENV PATH=$PATH:/usr/local/go/bin
# Install github.com/hashicorp/terraform-plugin-docs
RUN bash -c 'if [ "$(uname -m)" == "aarch64" ]; \
then \
arch=arm64; \
else \
arch=amd64; \
fi; \
wget https://github.com/hashicorp/terraform-plugin-docs/releases/download/v0.16.0/tfplugindocs_0.16.0_linux_${arch}.zip -O /tmp/tfplugindocs.zip && \
unzip /tmp/tfplugindocs.zip tfplugindocs && \
mv tfplugindocs /usr/local/bin/ && \
chmod +x /usr/local/bin/tfplugindocs && \
rm /tmp/tfplugindocs.zip'
WORKDIR /app
COPY requirements.txt .
RUN pip install --proxy=$http_proxy -r requirements.txt
RUN apt-get update
RUN apt-get update && \
apt-get install -y fonts-liberation xdg-utils \
software-properties-common curl unzip wget \
xvfb && \
apt-get clean all
# Install firefox and geckodriver
# Add unstable repo to allow for installation of newer firefox packages
RUN bash -c 'echo deb https://deb.debian.org/debian unstable main >> /etc/apt/sources.list'
RUN apt-get update && apt-get install -y firefox && apt-get clean all
RUN bash -c 'if [ "$(uname -m)" == "aarch64" ]; \
then \
arch=linux-aarch64; \
else \
arch=linux64; \
fi; \
wget https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-${arch}.tar.gz -O /tmp/geckodriver.tar.gz && \
tar -xzf /tmp/geckodriver.tar.gz -C /usr/local/bin/ && \
chmod +x /usr/local/bin/geckodriver && \
rm /tmp/geckodriver.tar.gz'
# Install packages for spell checking
RUN apt-get update && apt-get install -y hunspell-en-gb python3-enchant pylint && apt-get clean all
COPY requirements-dev.txt .
RUN pip install --proxy=$http_proxy -r requirements-dev.txt
ENV RUNNING_IN_DOCKER=1
COPY . .
ENTRYPOINT [""]