Skip to content

Commit

Permalink
Fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen0x7 committed Dec 25, 2024
1 parent cd300b9 commit 33bad0b
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 86 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ jobs:
docker:
strategy:
matrix:
include:
- short: amd64
version: linux/amd64
- short: arm64
version: linux/arm64
- short: arm7
version: linux/arm/v7
version: [1.85.0, 1.86.0, 1.87.0]
variant: [debug, release]
runs-on: ubuntu-latest
steps:
-
Expand All @@ -32,6 +27,9 @@ jobs:
name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: iantorres/boosted:${{ matrix.short }}-latest
platforms: ${{ matrix.version }}
tags: iantorres/boosted:${{ matrix.version }}-${{ matrix.variant }}
build-args: |
BOOST_VERSION=${{ matrix.version }}
BOOST_VARIANT=${{ matrix.variant }}
78 changes: 8 additions & 70 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,78 +1,16 @@
FROM debian:latest

ARG BOOST_VERSION="1.87.0"
ARG BOOST_VARIANT="release"

ENV TZ="UTC" \
DEBIAN_FRONTEND=noninteractive \
TERM=xterm-256color

WORKDIR /srv

RUN apt update -qq \
&& apt-get install -y -qq lsb-release gnupg git wget build-essential cmake gcc make apt-utils zip unzip tzdata libtool automake m4 re2c curl supervisor libssl-dev zlib1g-dev libcurl4-gnutls-dev libprotobuf-dev \
&& ln -fs /usr/share/zoneinfo/$TZ /etc/localtime \
&& dpkg-reconfigure -f noninteractive tzdata \
&& apt-get clean \
&& apt-get autoclean \
&& apt-get autoremove \
&& wget https://archives.boost.io/release/1.86.0/source/boost_1_86_0.tar.gz \
&& tar -xf boost_1_86_0.tar.gz \
&& cd boost_1_86_0 \
&& sh bootstrap.sh \
&& ./b2 install release variant=release debug-symbols=off optimization=speed \
--with-json \
--with-thread \
--with-headers \
--with-coroutine \
--with-iostreams \
--with-system \
--with-regex \
--with-system \
--with-serialization \
--with-program_options \
--with-exception \
--with-contract \
--with-container \
--with-context \
--with-chrono \
--with-locale \
--with-thread \
--with-test \
--with-timer \
--with-random \
--with-charconv \
--with-fiber \
--with-atomic \
--with-filesystem \
--with-date_time \
--with-url \
&& cd .. \
&& rm boost_1_86_0 -rf \
&& rm boost_1_86_0.tar.gz \
&& git clone https://github.com/trusch/libbcrypt \
&& cd libbcrypt \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
&& make install \
&& ldconfig \
&& cd .. \
&& cd .. \
&& rm libbcrypt -rf \
&& wget https://github.com/getsentry/sentry-native/releases/download/0.7.9/sentry-native.zip \
&& unzip sentry-native.zip -d sentry \
&& rm sentry-native.zip \
&& cd sentry \
&& cmake -B build -D SENTRY_BACKEND=crashpad -D CMAKE_BUILD_TYPE=Release \
&& cmake --build build --parallel \
&& cmake --install build \
&& cd .. \
&& rm sentry -rf \
&& git clone https://github.com/karastojko/mailio.git \
&& cd mailio \
&& cmake . -DMAILIO_BUILD_TESTS=OFF \
-DMAILIO_DYN_LINK_TESTS=OFF \
-DMAILIO_BUILD_EXAMPLES=OFF \
-DMAILIO_BUILD_DOCUMENTATION=OFF \
&& make install \
&& cd .. \
&& rm mailio -rf
COPY scripts/install_build_dependencies.bash install_build_dependencies.bash
COPY scripts/install_boost.bash install_boost.bash

RUN bash install_build_dependencies.bash \
&& bash install_boost.bash
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@

Shipshape and lightweight debian based docker image prepared and ready to build C++ and Boost Asio and Beast applications.

## Extras

- [**Bcrypt**](https://github.com/trusch/libbcrypt) for encryption.
- [**Sentry**](https://github.com/getsentry/sentry-native) for error logging.
- [**Mailio**](https://github.com/karastojko/mailio) for mail sending.

## Production ready

This image has been built to be used in production environment as boost and extras are compiled using release option.
This image has been built to be used in production environment as boost and extras are compiled using release option.
50 changes: 50 additions & 0 deletions scripts/install_boost.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
set -e
set -o pipefail

BOOST_VERSION_DASH=$(echo $BOOST_VERSION | sed 's/\./_/g')

if [ "$BOOST_VARIANT" == "debug" ]; then
DEBUG="on"
else
DEBUG="off"
fi

wget https://boostorg.jfrog.io/artifactory/main/release/$BOOST_VERSION/source/boost_$BOOST_VERSION_DASH.tar.gz

tar -xf boost_$BOOST_VERSION_DASH.tar.gz

cd boost_$BOOST_VERSION_DASH
sh bootstrap.sh

./b2 install $BOOST_VARIANT variant=$BOOST_VARIANT debug-symbols=$DEBUG \
--with-json \
--with-thread \
--with-headers \
--with-coroutine \
--with-iostreams \
--with-system \
--with-regex \
--with-system \
--with-serialization \
--with-program_options \
--with-exception \
--with-contract \
--with-container \
--with-context \
--with-chrono \
--with-locale \
--with-thread \
--with-test \
--with-timer \
--with-random \
--with-charconv \
--with-fiber \
--with-atomic \
--with-filesystem \
--with-date_time \
--with-url

cd ..
rm boost_$BOOST_VERSION_DASH -rf
rm boost_$BOOST_VERSION_DASH.tar.gz
34 changes: 34 additions & 0 deletions scripts/install_build_dependencies.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
set -e
set -o pipefail

apt update -qq

apt-get install -y -qq lsb-release \
gnupg \
git \
wget \
build-essential \
cmake \
gcc \
make \
apt-utils \
zip \
unzip \
tzdata \
libtool \
automake \
m4 \
re2c \
curl \
supervisor \
libssl-dev \
zlib1g-dev \
libcurl4-gnutls-dev \
libprotobuf-dev

ln -fs /usr/share/zoneinfo/$TZ /etc/localtime
dpkg-reconfigure -f noninteractive tzdata
apt-get clean
apt-get autoclean
apt-get autoremove

0 comments on commit 33bad0b

Please sign in to comment.