Project

General

Profile

Docker Image

Added by lm at about 2 years ago

Is there a WT docker image I can use?


Replies (3)

RE: Docker Image - Added by Roel Standaert about 2 years ago

I don't know of any published Docker images.

I do have a Dockerfile for one of my personal projects, that's based on Alpine: https://gitlab.com/arres/swedish/-/blob/master/Dockerfile

Maybe that can be of some help.

RE: Docker Image - Added by lm at about 2 years ago

Thank you, that is very helpful as always, Roel! I see the issues with boost. apk is still installing boost 1.78, but the ticket says it's fixed in 1.79, so I'll keep with the build-your-old boost formula. Thank you again!

RE: Docker Image - Added by lm at about 2 years ago

This worked for me; not many changes from what you provided.

from alpine:3.16.2 as builder

run apk add gcc g++ cmake ninja graphicsmagick-dev postgresql-dev zlib-dev linux-headers make libharu-dev
# We need to build Boost ourselves because of issue #688: https://github.com/boostorg/spirit/issues/688
# 1.75.0 is the last version without the regression
run mkdir /boost && \
    cd /boost && \
    wget https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2 && \
    tar xf boost_1_75_0.tar.bz2 && \
    cd boost_1_75_0 && \
    ./bootstrap.sh && \
    ./b2 link=shared --prefix=/boost/install-dir --with-atomic --with-chrono --with-date_time --with-program_options --with-filesystem --with-thread install && \
    cd .. && \
    rm boost_1_75_0.tar.bz2 && \
    rm -rf boost_1_75_0
arg WT_VERSION=4.8.1
run mkdir /wt && \
    cd /wt && \
    wget https://github.com/emweb/wt/archive/refs/tags/${WT_VERSION}.tar.gz -O wt-${WT_VERSION}.tar.gz && \
    tar xf wt-${WT_VERSION}.tar.gz && \
    mkdir wt-${WT_VERSION}/build && \
    cd wt-${WT_VERSION}/build && \
    cmake .. \
      -GNinja \
      -DCMAKE_CXX_STANDARD=17 \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick \
      -DENABLE_SQLITE=OFF \
      -DENABLE_POSTGRES=ON \
      -DBUILD_EXAMPLES=OFF \
      -DBUILD_TESTS=OFF \
      -DENABLE_LIBWTTEST=OFF \
      -DBOOST_PREFIX=/boost/install-dir \
      -DCMAKE_INSTALL_PREFIX=/wt/install-dir && \
    ninja install && \
    cd ../.. && \
    rm -rf wt-${WT_VERSION}
workdir /app
env ECXXFLAGS=-I/wt/install-dir/include
env LINKER_PATH="-L/wt/install-dir/lib -L/boost/install-dir/lib"
copy . /app
run make -j $(nproc)

from alpine:3.16.2
run apk add libharu g++ graphicsmagick
copy --from=builder /boost/install-dir/lib/libboost*.so.* /usr/local/lib/
copy --from=builder /wt/install-dir/lib/libwt*.so.* /usr/local/lib/
copy --from=builder /wt/install-dir/share /usr/local/share/
copy --from=builder /app/dist /app
workdir /app
entrypoint ["./chapters"]
cmd ["--deploy-path=/", "--docroot", ".;/css,/resources", "--http-address", "0.0.0.0", "--http-port", "9099"]
    (1-3/3)