-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
82 lines (69 loc) · 2.14 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
# Tool for providing link checks against a statically-built website.
# Set the base image to Ubuntu (version 18.04).
# Uses the new "ubuntu-minimal" image.
FROM ubuntu:22.04
LABEL maintainer="[email protected]"
################################################################################
# Install locale packages from Ubuntu repositories and set locale.
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get clean -y && \
apt-get update && \
apt-get install apt-utils -y && \
apt-get upgrade -y && \
apt-get install -y language-pack-en && \
locale-gen en_US.UTF-8 && \
dpkg-reconfigure locales \
&& \
apt-get --purge autoremove -y && \
apt-get clean -y \
&& \
rm -rf \
/tmp/* \
/var/cache/* \
/var/lib/apt/lists/* \
/var/log/*
# Set the defaults
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
################################################################################
# Install unversioned dependency packages from Ubuntu repositories.
ENV UNVERSIONED_DEPENDENCY_PACKAGES \
# Needed by the bash script to determine if this is the latest container.
curl \
jq \
# Needed to install the Python packages
build-essential \
python3-dev \
python3-pip \
python3-setuptools
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
${UNVERSIONED_DEPENDENCY_PACKAGES} \
&& \
apt-get --purge autoremove -y && \
apt-get clean -y \
&& \
rm -rf \
/tmp/* \
/var/cache/* \
/var/lib/apt/lists/* \
/var/log/*
################################################################################
# Install Python packages used by the link checker.
ENV PIP_PACKAGES \
bs4 \
aiohttp \
requests
RUN export DEBIAN_FRONTEND=noninteractive && \
pip3 install wheel && \
pip3 install ${PIP_PACKAGES}
COPY check_links_3.py check-links.sh /usr/local/bin/
RUN chmod a+rx /usr/local/bin/check_links_3.py /usr/local/bin/check-links.sh
################################################################################
# Record the Bamboo build job (if specified as an argument)
ARG bamboo_build
ENV BAMBOO_BUILD=${bamboo_build}
ENTRYPOINT ["/usr/local/bin/check-links.sh"]
CMD []