-
Notifications
You must be signed in to change notification settings - Fork 40
/
Dockerfile.template
96 lines (89 loc) · 2.96 KB
/
Dockerfile.template
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
# vim:set ft=dockerfile:
# Do not edit individual Dockerfiles manually. Instead, please make changes to the Dockerfile.template, which will be used by the build script to generate Dockerfiles.
# By policy, the base image tag should be a quarterly tag unless there's a
# specific reason to use a different one. This means January, April, July, or
# October.
FROM cimg/%%PARENT%%:2024.02
LABEL maintainer="CircleCI Execution Team <[email protected]>"
ENV RUBY_VERSION=%%VERSION_FULL%% \
RUBY_MAJOR=%%VERSION_MINOR%%
RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends \
autoconf \
bison \
dpkg-dev \
# Rails dep
ffmpeg \
# until the base image has it
libcurl4-openssl-dev \
libffi-dev \
libgdbm6 \
libgdbm-dev \
# Rails dep
libmysqlclient-dev \
libncurses5-dev \
# Rails dep
libpq-dev \
libreadline6-dev \
# install libsqlite3-dev until the base image has it
# Rails dep
libsqlite3-dev \
libssl-dev \
# Rails dep
libxml2-dev \
libyaml-dev \
# Rails dep
memcached \
# Rails dep
mupdf \
# Rails dep
mupdf-tools \
# Rails dep
imagemagick \
# Rails dep
sqlite3 \
zlib1g-dev \
# YJIT dep
rustc \
# Jemalloc
libjemalloc-dev \
# Build gems with Rust extensions dep
clang-14 && \
# For Ruby 3.0 install OpenSSL 1.1.1 to make it work on Ubuntu 20.04
if [ "${RUBY_MAJOR}" == "3.0" ]; then \
if [[ $(uname -m) == "x86_64" ]]; then \
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.1.1f-1ubuntu2_amd64.deb; \
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1f-1ubuntu2_amd64.deb; \
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb; \
else \
wget http://ports.ubuntu.com/pool/main/o/openssl/openssl_1.1.1f-1ubuntu2_arm64.deb; \
wget http://ports.ubuntu.com/pool/main/o/openssl/libssl-dev_1.1.1f-1ubuntu2_arm64.deb; \
wget http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb; \
fi && \
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2*.deb; \
sudo dpkg -i libssl-dev_1.1.1f-1ubuntu2*.deb; \
sudo dpkg -i openssl_1.1.1f-1ubuntu2*.deb; \
rm -f *.deb; \
fi && \
# Skip installing gem docs
echo "gem: --no-document" > ~/.gemrc && \
mkdir -p ~/ruby && \
downloadURL="https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR}/ruby-$RUBY_VERSION.tar.gz" && \
curl -sSL $downloadURL | tar -xz -C ~/ruby --strip-components=1 && \
cd ~/ruby && \
autoconf && \
./configure --enable-yjit --enable-shared --disable-install-doc && \
make -j "$(nproc)" && \
sudo make install && \
mkdir ~/.rubygems && \
sudo rm -rf ~/ruby /var/lib/apt/lists/* && \
cd && \
# Check that installs succeeded
ruby --version && \
gem --version && \
MAKEFLAGS=-j"$(nproc)" sudo gem update --system && \
gem --version && \
bundle --version && \
# Cleanup YJIT install deps
sudo apt-get remove rustc libstd-rust*
ENV GEM_HOME=/home/circleci/.rubygems
ENV PATH=$GEM_HOME/bin:$BUNDLE_PATH/gems/bin:$PATH