# pkg-config --cflags -- MagickWand MagickCore MagickWand MagickCore | Docker | golang:alpine AS build

Am new to golang, and I need to generate a thumbnail from pdf when I upload it. am using ImageMagick with docker and golang.

But am getting challenged on building docker image including ImageMagick

Docker set up

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


ENTRYPOINT /go/bin/web-app --port 1000

when I build my docker, am getting this error.

Please kindly help out on this. Thank you.

Maybe your Alpine image doesn’t come with pkg-config pre-installed? What if you change your RUN apk ... line to:

RUN apk --no-cache add gcc g++ make git pkgconfig

Thank you so much for help
but when i do that still i get this error

A few days ago a friend shared with me the following docker:

Libvips seems to be faster than imagemagick

Maybe try adding imagemagick to your apk install list?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.