GithubHelp home page GithubHelp logo

Comments (7)

divick avatar divick commented on August 20, 2024 39

Here is the recipe for docker image based on node:10-15-alpine, which has node v10 and yarn already installed.

One can use alpine-3.9 image too but would need to add build steps to install node and yarn/npm.

FROM node:10.15-alpine                                                                            
                                                                                                  
RUN apk --no-cache add shadow \                                                                   
    gcc \                                                                                         
    musl-dev \                                                                                    
    autoconf \                                                                                    
    automake \                                                                                    
    make \                                                                                        
    libtool \                                                                                     
    nasm \                                                                                        
    tiff \                                                                                        
    jpeg \                                                                                        
    zlib \                                                                                        
    zlib-dev \                                                                                    
    file \                                                                                        
    pkgconf \                                                                                     
    && yarn install

from mozjpeg-bin.

BenMatheja avatar BenMatheja commented on August 20, 2024 10

Want to extend what @divick wrote.
With the current image of node:alpine these dependencies allowed me to build mozjpeg within my drone-runner

- name: npm install
    image: node:alpine
    commands:
      - apk add autoconf automake libtool make tiff jpeg zlib zlib-dev pkgconf nasm file gcc musl-dev
      - npm install

from mozjpeg-bin.

divick avatar divick commented on August 20, 2024 3

+1

from mozjpeg-bin.

divick avatar divick commented on August 20, 2024 3

@kachkaev I have been able to resolve this issue. On investigating I found that imagemin-mozjpeg installs mozjpeg-bin but in absence of autoconf, automake, libtool, make, gcc, musl-dev and nasm cannot build mozjpeg-bin from source and pulls in a GLIBC linked binary from github. Since alpine linux has musl-dev, the cjpeg cannot run without rebuilding/relinking with musl libc.

Just install the above packages with apk add and then do npm install and it should work.

from mozjpeg-bin.

1000ch avatar 1000ch commented on August 20, 2024 1

As above, we need to install appropriate dependencies for mozjpeg to use it on any platform including alpine.

from mozjpeg-bin.

kachkaev avatar kachkaev commented on August 20, 2024

Great news @divick! Feel free to share the dockerfile recipe. I probably won’t change my setup for now, but people coming here from search will definitely be happy to see the solution!

from mozjpeg-bin.

divick avatar divick commented on August 20, 2024

Additionally you may need zlib-dev, pkgconf and file packages to be installed in alpine image.

from mozjpeg-bin.

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.