Skip to content

Commit 7ddaa51

Browse files
committed
ci: build base test docker image
1 parent d40842e commit 7ddaa51

2 files changed

Lines changed: 156 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Base Test Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
# TEMPORARY: Replace with main once bs5 is merged
7+
- 'feat/bs5'
8+
paths:
9+
- 'package.json'
10+
- 'requirements.txt'
11+
12+
workflow_dispatch:
13+
14+
env:
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: datatracker-test-base
17+
18+
jobs:
19+
publish:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
28+
- name: Docker Build & Push Action
29+
uses: mr-smithers-excellent/docker-build-push@v5.6
30+
with:
31+
image: ${{ env.IMAGE_NAME }}
32+
tags: latest
33+
registry: ${{ env.REGISTRY }}
34+
dockerfile: dev/docker-test-base/Dockerfile
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}

dev/docker-test-base/Dockerfile

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
FROM python:3.6-bullseye
2+
LABEL maintainer="IETF Tools Team <tools-discuss@ietf.org>"
3+
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
6+
RUN apt-get update
7+
RUN apt-get -qy upgrade
8+
9+
# Add Node.js Source
10+
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
11+
12+
# Install the packages we need
13+
RUN apt-get install -qy \
14+
apache2-utils \
15+
apt-file \
16+
apt-utils \
17+
bash \
18+
build-essential \
19+
curl \
20+
enscript \
21+
gawk \
22+
gcc \
23+
ghostscript \
24+
git \
25+
gnupg \
26+
graphviz \
27+
jq \
28+
less \
29+
libcairo2-dev \
30+
libgtk2.0-0 \
31+
libgtk-3-0 \
32+
libnotify-dev \
33+
libgconf-2-4 \
34+
libgbm-dev \
35+
libnss3 \
36+
libxss1 \
37+
libasound2 \
38+
libxtst6 \
39+
libmagic-dev \
40+
libmariadb-dev \
41+
libtidy-dev \
42+
locales \
43+
mariadb-client \
44+
netcat \
45+
nodejs \
46+
pigz \
47+
pv \
48+
python3-ipython \
49+
ripgrep \
50+
rsync \
51+
rsyslog \
52+
ruby \
53+
ruby-rubygems \
54+
unzip \
55+
wget \
56+
xauth \
57+
xvfb \
58+
yang-tools
59+
60+
# Install kramdown-rfc2629 (ruby)
61+
RUN gem install kramdown-rfc2629
62+
63+
# Install chromedriver
64+
COPY docker/scripts/app-install-chromedriver.sh /tmp/app-install-chromedriver.sh
65+
RUN sed -i 's/\r$//' /tmp/app-install-chromedriver.sh && \
66+
chmod +x /tmp/app-install-chromedriver.sh
67+
RUN /tmp/app-install-chromedriver.sh
68+
69+
# Get rid of installation files we don't need in the image, to reduce size
70+
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
71+
72+
# "fake" dbus address to prevent errors
73+
# https://github.com/SeleniumHQ/docker-selenium/issues/87
74+
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null
75+
76+
# avoid million NPM install messages
77+
ENV npm_config_loglevel warn
78+
# allow installing when the main user is root
79+
ENV npm_config_unsafe_perm true
80+
# disable NPM funding messages
81+
ENV npm_config_fund false
82+
83+
# Set locale to en_US.UTF-8
84+
RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \
85+
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
86+
echo "LANG=en_US.UTF-8" > /etc/locale.conf && \
87+
dpkg-reconfigure locales && \
88+
locale-gen en_US.UTF-8 && \
89+
update-locale LC_ALL en_US.UTF-8
90+
ENV LC_ALL en_US.UTF-8
91+
92+
# Install idnits
93+
ADD https://raw.githubusercontent.com/ietf-tools/idnits-mirror/main/idnits /usr/local/bin/
94+
RUN chmod +rx /usr/local/bin/idnits
95+
96+
# Install current datatracker python dependencies
97+
COPY requirements.txt /tmp/pip-tmp/
98+
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
99+
&& rm -rf /tmp/pip-tmp
100+
101+
# Turn off rsyslog kernel logging (doesn't work in Docker)
102+
RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf
103+
104+
# Fetch wait-for utility
105+
ADD https://raw.githubusercontent.com/eficode/wait-for/v2.1.3/wait-for /usr/local/bin/
106+
RUN chmod +rx /usr/local/bin/wait-for
107+
108+
# Copy the startup file
109+
COPY docker/scripts/app-init.sh /docker-init.sh
110+
RUN sed -i 's/\r$//' /docker-init.sh && \
111+
chmod +x /docker-init.sh
112+
113+
# Create workspace
114+
RUN mkdir -p /workspace
115+
WORKDIR /workspace
116+
117+
# Install NPM modules
118+
COPY package.json package.json
119+
RUN npm install --no-audit
120+
RUN rm -f package.json package-lock.json

0 commit comments

Comments
 (0)