Skip to content

Error while compiling  #144

@divyam234

Description

@divyam234
ERROR: failed to solve: process "/bin/sh -c xx-apk add --no-cache gcc musl-dev vips-dev" did not complete successfully: exit code: 4
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c xx-apk add --no-cache gcc musl-dev vips-dev" did not complete successfully: exit code: 4
FROM --platform=${BUILDPLATFORM} tonistiigi/xx AS cc-helpers
FROM --platform=${BUILDPLATFORM} golang:alpine as builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH

RUN apk add clang lld libcap-utils

COPY --from=cc-helpers / /

RUN xx-apk add --no-cache gcc musl-dev vips-dev

ENV CGO_ENABLED=1

COPY go.mod go.sum ./

RUN go mod download

COPY main.go ./

RUN xx-go build -o main &&  xx-verify main

FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine

RUN apk add --no-cache vips-dev

WORKDIR /app

RUN adduser -D -u 1000 user

COPY --chown=user:user --from=builder /main /app/main

USER user

ENV MALLOC_ARENA_MAX 2

ENTRYPOINT ["/app/main" ]

Not able to compile go app

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions