Skip to content

Commit fc8f534

Browse files
committed
Add docker
1 parent 317fcd6 commit fc8f534

File tree

3 files changed

+101
-42
lines changed

3 files changed

+101
-42
lines changed

docker/debian/Dockerfile

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,46 @@ LABEL org.opencontainers.image.source=https://github.com/${GITHUB_REPO}
2323
# manual interaction.
2424
ARG DEBIAN_FRONTEND=noninteractive
2525
RUN apt update && apt upgrade -y
26-
RUN set -ex ;\
27-
ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime ;\
28-
apt install -y tzdata ;\
29-
dpkg-reconfigure --frontend noninteractive tzdata
26+
RUN <<EOF
27+
set -ex
28+
ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
29+
apt install -y tzdata
30+
dpkg-reconfigure --frontend noninteractive tzdata
31+
EOF
3032

3133
# Install tools that are shared by all stages.
3234
RUN <<EOF
33-
pkgs=()
34-
pkgs+=(build-essential) # Required build tools.
35-
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
36-
pkgs+=(cmake) # Required build tool.
37-
pkgs+=(curl) # Dependency for tools requiring downloading data.
38-
pkgs+=(git) # Required build tool.
39-
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
40-
pkgs+=(jq) # Pretty printing.
41-
pkgs+=(ninja-build) # Required build tool.
42-
pkgs+=(pipx) # Package manager for Python applications.
43-
apt install -y "${pkgs[@]}"
35+
pkgs=()
36+
pkgs+=(build-essential) # Required build tools.
37+
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
38+
pkgs+=(cmake) # Required build tool.
39+
pkgs+=(curl) # Dependency for tools requiring downloading data.
40+
pkgs+=(git) # Required build tool.
41+
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
42+
pkgs+=(jq) # Pretty printing.
43+
pkgs+=(ninja-build) # Required build tool.
44+
pkgs+=(pipx) # Package manager for Python applications.
45+
apt install -y "${pkgs[@]}"
46+
EOF
47+
48+
# Install Docker, see https://docs.docker.com/engine/install/debian.
49+
RUN <<EOF
50+
set -ex
51+
install -m 0755 -d /etc/apt/keyrings
52+
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
53+
chmod a+r /etc/apt/keyrings/docker.asc
54+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
55+
https://download.docker.com/linux/debian \
56+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
57+
tee /etc/apt/sources.list.d/docker.list > /dev/null
58+
apt update
59+
pkgs=()
60+
pkgs+=(docker-ce)
61+
pkgs+=(docker-ce-cli)
62+
pkgs+=(containerd.io)
63+
pkgs+=(docker-buildx-plugin)
64+
pkgs+=(docker-compose-plugin)
65+
apt install -y "${pkgs[@]}"
4466
EOF
4567

4668
# Install Conan.
@@ -126,7 +148,7 @@ RUN conan profile detect
126148
# Fix the C++ dialect.
127149
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
128150
# To ensure compatibility with a range of Clang compilers, we must add extra
129-
# flags that applies to certain versions of Clang.
151+
# flags that apply to certain versions of Clang.
130152
RUN <<EOF
131153
if [[ $(clang-${CLANG_VERSION} --version | head -1 | grep -Po 'version \K[0-9]{2}') -ge 20 ]]; then
132154
cat >>~/.conan2/profiles/default <<EOT

docker/rhel/Dockerfile

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,30 @@ LABEL org.opencontainers.image.source=https://github.com/${GITHUB_REPO}
1515

1616
# Install tools that are shared by all stages.
1717
RUN <<EOF
18-
pkgs=()
19-
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
20-
pkgs+=(cmake) # Required build tool.
21-
pkgs+=(jq) # Pretty printing.
22-
pkgs+=(libstdc++-static) # Required to statically link libraries into rippled.
23-
pkgs+=(ninja-build) # Required build tool.
24-
pkgs+=(perl-FindBin) # Required to compile OpenSSL.
25-
pkgs+=(python3-pip) # Package manager for Python applications.
26-
dnf install -y --setopt=tsflags=nodocs "${pkgs[@]}"
18+
pkgs=()
19+
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
20+
pkgs+=(cmake) # Required build tool.
21+
pkgs+=(git) # Required build tool.
22+
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
23+
pkgs+=(jq) # Pretty printing.
24+
pkgs+=(libstdc++-static) # Required to statically link libraries into rippled.
25+
pkgs+=(ninja-build) # Required build tool.
26+
pkgs+=(perl-FindBin) # Required to compile OpenSSL.
27+
pkgs+=(python3-pip) # Package manager for Python applications.
28+
dnf install -y --setopt=tsflags=nodocs "${pkgs[@]}"
29+
EOF
30+
31+
# Install Docker, see https://docs.docker.com/engine/install/rhel.
32+
RUN <<EOF
33+
dnf -y install dnf-plugins-core
34+
dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
35+
pkgs=()
36+
pkgs+=(docker-ce)
37+
pkgs+=(docker-ce-cli)
38+
pkgs+=(containerd.io)
39+
pkgs+=(docker-buildx-plugin)
40+
pkgs+=(docker-compose-plugin)
41+
dnf install -y --setopt=tsflags=nodocs "${pkgs[@]}"
2742
EOF
2843

2944
# Install Conan.
@@ -78,7 +93,7 @@ RUN conan profile detect
7893
# Fix the C++ dialect.
7994
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
8095
# To ensure compatibility with a range of Clang compilers, we must add extra
81-
# flags that applies to certain versions of Clang.
96+
# flags that apply to certain versions of Clang.
8297
RUN <<EOF
8398
if [[ $(clang --version | head -1 | grep -Po 'version \K[0-9]{2}') -ge 20 ]]; then
8499
cat >>${CONAN_HOME}/profiles/default <<EOT

docker/ubuntu/Dockerfile

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,46 @@ LABEL org.opencontainers.image.source=https://github.com/${GITHUB_REPO}
1414
# manual interaction.
1515
ARG DEBIAN_FRONTEND=noninteractive
1616
RUN apt update && apt upgrade -y
17-
RUN set -ex ;\
18-
ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime ;\
19-
apt install -y tzdata ;\
20-
dpkg-reconfigure --frontend noninteractive tzdata
17+
RUN <<EOF
18+
set -ex
19+
ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
20+
apt install -y tzdata
21+
dpkg-reconfigure --frontend noninteractive tzdata
22+
EOF
2123

2224
# Install tools that are shared by all stages.
2325
RUN <<EOF
24-
pkgs=()
25-
pkgs+=(build-essential) # Required build tools.
26-
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
27-
pkgs+=(cmake) # Required build tool.
28-
pkgs+=(curl) # Dependency for tools requiring downloading data.
29-
pkgs+=(git) # Required build tool.
30-
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
31-
pkgs+=(jq) # Pretty printing.
32-
pkgs+=(ninja-build) # Required build tool.
33-
pkgs+=(pipx) # Package manager for Python applications.
34-
apt install -y "${pkgs[@]}"
26+
pkgs=()
27+
pkgs+=(build-essential) # Required build tools.
28+
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
29+
pkgs+=(cmake) # Required build tool.
30+
pkgs+=(curl) # Dependency for tools requiring downloading data.
31+
pkgs+=(git) # Required build tool.
32+
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
33+
pkgs+=(jq) # Pretty printing.
34+
pkgs+=(ninja-build) # Required build tool.
35+
pkgs+=(pipx) # Package manager for Python applications.
36+
apt install -y "${pkgs[@]}"
37+
EOF
38+
39+
# Install Docker, see https://docs.docker.com/engine/install/ubuntu.
40+
RUN <<EOF
41+
set -ex
42+
install -m 0755 -d /etc/apt/keyrings
43+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
44+
chmod a+r /etc/apt/keyrings/docker.asc
45+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
46+
https://download.docker.com/linux/ubuntu \
47+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
48+
tee /etc/apt/sources.list.d/docker.list > /dev/null
49+
apt update
50+
pkgs=()
51+
pkgs+=(docker-ce)
52+
pkgs+=(docker-ce-cli)
53+
pkgs+=(containerd.io)
54+
pkgs+=(docker-buildx-plugin)
55+
pkgs+=(docker-compose-plugin)
56+
apt install -y "${pkgs[@]}"
3557
EOF
3658

3759
# Install Conan.
@@ -89,7 +111,7 @@ RUN conan profile detect
89111
# Fix the C++ dialect.
90112
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
91113
# To ensure compatibility with a range of Clang compilers, we must add extra
92-
# flags that applies to certain versions of Clang.
114+
# flags that apply to certain versions of Clang.
93115
RUN <<EOF
94116
if [[ $(clang-${CLANG_VERSION} --version | head -1 | grep -Po 'version \K[0-9]{2}') -ge 20 ]]; then
95117
cat >>~/.conan2/profiles/default <<EOT

0 commit comments

Comments
 (0)