Install libvips on golang docker container

WBOY
Release: 2024-02-09 19:33:09
forward
983 people have browsed it

在 golang docker 容器上安装 libvips

#php editor Strawberry will introduce to you how to install libvips on the golang docker container. libvips is a fast and efficient image processing library that can be used in various application scenarios. In docker containers built with golang, installing libvips can provide powerful support for image processing. This article will introduce in detail the steps and precautions for installing libvips. I hope it will be helpful to everyone.

Question content

How to install libvips on a Docker container.

Solution

My opinion on this.

FROM ubuntu:20.04
    
    RUN mkdir /app
            
    COPY imgApp /app
    
    ARG DEBIAN_FRONTEND=noninteractive
    RUN apt-get update && apt-get install -y \
            build-essential \
            wget \
            git \
            pkg-config
    
    RUN apt-get install -y python3 python3-pip python3-setuptools \
                           python3-wheel
    RUN pip3 install meson ninja
    
    RUN apt-get install -y \
            libexpat1-dev \
            librsvg2-dev \
            libpng-dev \
            libjpeg-dev \
            libwebp-dev \
            libexif-dev \
            liblcms2-dev \
            libglib2.0-dev \
            liborc-dev \
            libgirepository1.0-dev \
            gettext 
    
    ARG VIPS_VER=8.14.2
    ARG VIPS_DLURL=https://github.com/libvips/libvips/releases/download
    RUN cd /usr/local/src \
            && wget ${VIPS_DLURL}/v${VIPS_VER}/vips-${VIPS_VER}.tar.xz \
            && tar xf vips-${VIPS_VER}.tar.xz \
            && cd vips-${VIPS_VER}
            && meson setup build --buildtype=release \
            && cd build \
            && meson compile \
            && meson test \
            && meson install
    RUN ldconfig
            
    RUN export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/vips/lib
Copy after login

Hope someone can do better in the future.

The above is the detailed content of Install libvips on golang docker container. For more information, please follow other related articles on the PHP Chinese website!

source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!