Giter Site home page Giter Site logo

Installation on Alpine linux about dlisio HOT 3 CLOSED

rkhabbaz avatar rkhabbaz commented on August 27, 2024
Installation on Alpine linux

from dlisio.

Comments (3)

rkhabbaz avatar rkhabbaz commented on August 27, 2024 2

Hi Alena,

Thank you so much. indeed it works like a charm.
I changed it a bit to clean up after the installation. I share it here in case someone is interested.

Base image

FROM python:3.10-alpine

RUN apk -U upgrade --no-cache
&& apk add --no-cache git make cmake g++
&& pip install --upgrade pip

Keeps Python from generating .pyc files in the container

ENV PYTHONDONTWRITEBYTECODE=1

Turns off buffering for easier container logging

ENV PYTHONUNBUFFERED=1

#mpark variant
WORKDIR /tmp
RUN git clone https://github.com/mpark/variant.git
WORKDIR /tmp/variant/build
RUN cmake -DCMAKE_BUILD_TYPE=Release ..
&& make -j4
&& make install

#fmt
WORKDIR /tmp
RUN git clone https://github.com/fmtlib/fmt.git
WORKDIR /tmp/fmt/build
RUN git checkout 7.1.3
&& cmake -DFMT_TEST=OFF -DFMT_DOC=OFF ..
&& make -j4
&& make install

#lfp
WORKDIR /tmp
RUN git clone https://github.com/equinor/layered-file-protocols.git
WORKDIR /tmp/layered-file-protocols/build
RUN cmake -DBUILD_SHARED_LIBS=ON -DLFP_FMT_HEADER_ONLY=ON -DCMAKE_INSTALL_NAME_DIR=/usr/local/lib -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
&& make -j4
&& make install

#dlisio
WORKDIR /tmp
RUN git clone https://github.com/equinor/dlisio.git
WORKDIR /tmp/dlisio
RUN git checkout v1.0.0
&& pip install -r python/requirements-dev.txt
WORKDIR /tmp/dlisio/build
RUN cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_NAME_DIR=/usr/local/lib ..
&& make -j4
&& make install

Remove unwanted files and folders created during the last 4 layers in /tmp

WORKDIR /tmp
RUN rm -rf *

Remove unwanted packages after building dlisio from source

RUN apk del git make cmake

from dlisio.

achaikou avatar achaikou commented on August 27, 2024

Hi!

Thank you for the report.

Unfortunately dlisio doesn't build musllinux wheels, so you get this error on alpine.
We will see if we can make them available through pip in the next release.

For now you can either use a non-alpine base image for your build, or you can build dlisio yourself. Looks like it works fine.

FROM python:3.10-alpine

RUN apk update
RUN apk upgrade --no-cache
RUN apk add --no-cache git make cmake g++ python3 py3-pip py3-virtualenv

#mpark variant
WORKDIR /home/ci
RUN git clone https://github.com/mpark/variant.git
WORKDIR /home/ci/variant/build
RUN cmake -DCMAKE_BUILD_TYPE=Release ..
RUN make -j4
RUN make install

#fmt
WORKDIR /home/ci
RUN git clone https://github.com/fmtlib/fmt.git
WORKDIR /home/ci/fmt/build
RUN git checkout 7.1.3
RUN cmake -DFMT_TEST=OFF -DFMT_DOC=OFF ..
RUN make -j4
RUN make install

#lfp
WORKDIR /home/ci
RUN git clone https://github.com/equinor/layered-file-protocols.git
WORKDIR /home/ci/layered-file-protocols/build
RUN cmake -DBUILD_SHARED_LIBS=ON -DLFP_FMT_HEADER_ONLY=ON -DCMAKE_INSTALL_NAME_DIR=/usr/local/lib -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
RUN make -j4
RUN make install

#dlisio
WORKDIR /home/ci
RUN git clone https://github.com/equinor/dlisio.git
WORKDIR /home/ci/dlisio
RUN git checkout v1.0.0
RUN python3 -m venv venv
RUN . venv/bin/activate
RUN /home/ci/dlisio/venv/bin/python -m pip install --upgrade pip
RUN /home/ci/dlisio/venv/bin/python -m pip install -r python/requirements-dev.txt

WORKDIR /home/ci/dlisio/build
RUN cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_NAME_DIR=/usr/local/lib -DPYTHON_EXECUTABLE="/home/ci/dlisio/venv/bin/python" ..
RUN make -j4
RUN ctest --verbose
RUN make install

RUN "/home/ci/dlisio/venv/bin/python" -c "import dlisio; print(dlisio.__version__)"

from dlisio.

achaikou avatar achaikou commented on August 27, 2024

FYI: for version 1.0.1 musllinux x86_64 wheels are supplied through pip, so there should be no need anymore to build from source for docker on standard architecture.

from dlisio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.