bimg icon indicating copy to clipboard operation
bimg copied to clipboard

# pkg-config --cflags -- vips vips vips vips, pkg-config: exec: "pkg-config": executable file not found in $PATH

Open andysteve opened this issue 3 years ago • 7 comments

Hello Am new to golang, working on a project to take a thumbnail from the first page of a pdf am using bimg package to help do the task but am going an error below when i build my docker image

Docker Image

FROM golang:alpine AS build RUN apk --no-cache add gcc g++ make git

WORKDIR /go/src/app

COPY go.mod . COPY go.sum . RUN go mod download COPY . .

RUN GOOS=linux go build -ldflags="-s -w" -o ./bin/web-app ./main.go

FROM alpine:3.13 RUN apk --no-cache add ca-certificates WORKDIR /usr/bin COPY --from=build /go/src/app/bin /go/bin EXPOSE 2022 ENTRYPOINT /go/bin/web-app --port 2022


image

pkg-config --cflags -- vips vips vips vips

pkg-config: exec: "pkg-config": executable file not found in $PATH

Kindly help with this error Thanks

andysteve avatar Dec 28 '21 19:12 andysteve

You should add vips-dev package in RUN command.

egor-spk avatar Jan 14 '22 14:01 egor-spk

RUN apk add --update --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing --repository http://dl-3.alpinelinux.org/alpine/edge/main vips-dev vips-poppler RUN apk add --no-cache poppler-dev

You should add dependency in Dockerfile, and add poppler to support pdf format

chenqing-yuhu avatar Mar 17 '22 03:03 chenqing-yuhu

you should export "export CGO_CFLAGS_ALLOW=-Xpreprocessor" when you use golang

BlackCodes avatar Mar 26 '22 05:03 BlackCodes

apk add gcc g++ vips-dev vips-poppler pkgconf

export PKG_CONFIG_PATH=/usr/bin/pkgconf

sanmiaohub avatar Jun 10 '22 05:06 sanmiaohub

hello, I have the same problem: I run : go run . on the terminal... how can I install vips? or I should run command: export CGO_CFLAGS_ALLOW=-Xpreprocessor I am lost. thanks 4 the help

hcasellas avatar Nov 04 '22 20:11 hcasellas

hello, I have the same problem:

I run : go run . on the terminal...

how can I install vips? or I should run command: export CGO_CFLAGS_ALLOW=-Xpreprocessor

I am lost. thanks 4 the help

Try RUN export CGO_CFLAGS_ALLOW=".*"

chenqing-yuhu avatar Nov 04 '22 23:11 chenqing-yuhu

I got this:

export : El término 'export' no se reconoce como nombre de un cmdlet, función, archivo de script o programa ejecutable. Compruebe si escribió correctamente el nombre o, si incluyó una ruta de acceso,
compruebe que dicha ruta es correcta e inténtelo de nuevo. En línea: 1 Carácter: 1

  • export CGO_CFLAGS_ALLOW=".*"
  •   + CategoryInfo          : ObjectNotFound: (export:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

hcasellas avatar Nov 07 '22 12:11 hcasellas