-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
96 lines (82 loc) · 3.85 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
84
85
86
87
88
89
90
91
92
93
94
95
96
FROM quay.io/centos/centos:stream8
ENV BUNDLER_VERSION="2.2.25"
ARG DB=mysql
ENV PATH="./node_modules/.bin:$PATH" \
DISPLAY=:99.0 \
SKIP_ASSETS="1" \
TZ=:/etc/localtime \
LD_LIBRARY_PATH="/opt/oracle/instantclient/:$LD_LIBRARY_PATH" \
ORACLE_HOME=/opt/oracle/instantclient/ \
DB=$DB
USER root
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& dnf -y module enable ruby:3.1 nodejs:18 mysql:8.0 \
&& dnf install -y --setopt=skip_missing_names_on_install=False,tsflags=nodocs \
ruby-devel rubygem-rdoc rubygem-irb \
nodejs \
sudo which file shared-mime-info unzip jq git \
postgresql libpq-devel mysql-devel zlib-devel gd-devel libxml2-devel libxslt-devel \
make automake gcc gcc-c++ redhat-rpm-config \
# needed for PDF generation \
liberation-sans-fonts \
# needed for ruby-oci8 gem \
libnsl libaio \
# needed to download memkind/jemalloc sources \
'dnf-command(download)' \
&& echo --color > ~/.rspec \
&& gem install bundler --version ${BUNDLER_VERSION} --no-doc \
&& echo 'default ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers \
&& npm install -g yarn \
&& rm -rf ~/.npm ~/.config
# we can just install memkind package once it is fixed, see
# https://issues.redhat.com/browse/RHEL-14497
RUN mkdir /tmp/memkind \
&& cd /tmp/memkind \
&& dnf download --source memkind \
&& rpm2cpio memkind-*.src.rpm | cpio -idmv "memkind-*.tar.gz" \
&& tar xvfz memkind-*.tar.gz \
&& cd memkind-*/jemalloc/ \
&& ./autogen.sh && ./configure --libdir=/usr/local/lib64/ && make install \
&& echo /usr/local/lib64 > /etc/ld.so.conf.d/jemalloc.conf \
&& ldconfig && ldconfig -p | grep jemalloc \
&& cd && rm -rf /tmp/memkind
# chrome + driver
RUN echo $'\n\
[google-chrome]\n\
name=google-chrome\n\
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub' \
> /etc/yum.repos.d/google-chrome.repo \
&& dnf install -y --setopt=skip_missing_names_on_install=False,tsflags=nodocs firefox google-chrome-stable \
&& CHROME_VERSION=$(google-chrome --version | sed -e "s|[^0-9]*\([0-9]\+\).*|\1|") \
&& driver=$(curl -s "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json" | jq --arg majorVersion "$CHROME_VERSION" -r '.channels.Stable | select(.version | startswith($majorVersion | tostring)).downloads.chromedriver[] | select(.platform == "linux64") | .url') \
&& wget -N --progress=dot:giga "$driver" -O /tmp/chromedriver-linux64.zip \
&& unzip -j /tmp/chromedriver-linux64.zip -d /tmp \
&& rm /tmp/chromedriver-linux64.zip \
&& mv -f /tmp/chromedriver /usr/local/bin/chromedriver \
&& chown root:root /usr/local/bin/chromedriver \
&& chmod 0755 /usr/local/bin/chromedriver
# geckodriver
RUN geckodriver=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r '.assets[].browser_download_url | select(contains("linux64") and (endswith(".asc") | not))') \
&& curl -sL "$geckodriver" | tar -xzv -C /usr/local/bin/
# manticore search
RUN dnf install -y https://repo.manticoresearch.com/manticore-repo.noarch.rpm \
&& dnf install -y manticore-server
WORKDIR /opt/ci
RUN dbus-uuidgen | tee /etc/machine-id \
&& useradd -d /opt/ci -r default \
&& chown -R default /opt/ci \
&& chmod -R g+w /opt/ci \
&& dnf clean all -y
# TODO: circleci fails "Preparing environment variables" with these
# ENV LD_PRELOAD=libautohbw.so.0 \
# AUTO_HBW_SIZE=10240G \
# AUTO_HBW_LOG=-2 \
# MEMKIND_HBW_NODES=0 \
# MEMKIND_HEAP_MANAGER=JEMALLOC
# RUN ldd /bin/grep | grep libautohbw.so.0
USER default
ENTRYPOINT ["/bin/bash", "-c", "exec \"$@\"", "--"]