Skip to content

Commit

Permalink
CI: Update Dockerfile to install OpenSSL 3
Browse files Browse the repository at this point in the history
The custom container is no longer required since the upstream image has
removed (the old version of) OpenSSL entirely.
  • Loading branch information
tesaguri committed Jul 24, 2023
1 parent e51ae8a commit 3c0de0c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 14 deletions.
10 changes: 3 additions & 7 deletions docker/aarch64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
FROM ghcr.io/tesaguri/cross:aarch64-unknown-linux-gnu
FROM rustembedded/cross:aarch64-unknown-linux-gnu

RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install --assume-yes libsqlite3-dev libsqlite3-dev:arm64 libssl-dev:arm64

ENV PKG_CONFIG_ALLOW_CROSS_aarch64_unknown_linux_gnu=1 \
PKG_CONFIG_PATH_aarch64_unknown_linux_gnu='/usr/lib/aarch64-linux-gnu/pkgconfig'
COPY install_packages.sh /
RUN /install_packages.sh arm64
10 changes: 3 additions & 7 deletions docker/armv7-unknown-linux-gnueabihf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
FROM ghcr.io/tesaguri/cross:armv7-unknown-linux-gnueabihf
FROM rustembedded/cross:armv7-unknown-linux-gnueabihf

RUN dpkg --add-architecture armhf && \
apt-get update && \
apt-get install --assume-yes libsqlite3-dev libsqlite3-dev:armhf libssl-dev:armhf

ENV PKG_CONFIG_ALLOW_CROSS_armv7_unknown_linux_gnueabihf=1 \
PKG_CONFIG_PATH_armv7_unknown_linux_gnueabihf='/usr/lib/arm-linux-gnueabihf/pkgconfig'
COPY install_packages.sh /
RUN /install_packages.sh armhf
30 changes: 30 additions & 0 deletions docker/install_packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -xeo pipefail

RUN dpkg --add-architecture "$1"

if grep -Eq '^UBUNTU_CODENAME=focal$' /etc/os-release; then
# Use `libssl3` package from Ubuntu 22.04 (jammy) since 20.04 (focal) doesn't have the package.
# <https://amedee.be/install-libssl3-on-systems-before-jammy/>
echo 'APT::Default-Release "focal";' > /etc/apt/apt.conf.d/01ubuntu
awk '($1$3$4=="debfocalmain"){$3="jammy" ;print}' /etc/apt/sources.list \
> /etc/apt/sources.list.d/jammy.list
cat <<-EOF /etc/apt/preferences.d/libssl3
Package: libssl3
Pin: release n=jammy
Pin-Priority: 900
EOF
cat <<-EOF > /etc/apt/preferences.d/libssl-dev
Package: libssl-dev
Pin: release n=jammy
Pin-Priority: 900
EOF
fi

apt-get update
apt-get install --assume-yes --no-install-recommends \
libsqlite3-dev \
libsqlite3-dev:"$1" \
libssl3:"$1" \
libssl-dev:"$1"

0 comments on commit 3c0de0c

Please sign in to comment.