Skip to content

Commit

Permalink
build: attempt to fix build on arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
Veirt committed Oct 29, 2024
1 parent 0435ac8 commit 0c7e1a9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o miyo cmd/main.go

ARG TARGETPLATFORM

# Download stage for Real-ESRGAN models
FROM alpine:3.19 AS downloader
WORKDIR /download
Expand Down Expand Up @@ -51,7 +53,12 @@ RUN sed -i 's|[email protected]:|https://github.com/|g' .gitmodules \

# Final stage
FROM alpine:3.19 AS runner
RUN apk update && apk add --no-cache libgomp vulkan-tools mesa-vulkan-ati mesa-vulkan-intel mesa-vulkan-layers libgcc
RUN apk update && \
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
apk add --no-cache libgomp vulkan-tools mesa-vulkan-ati mesa-vulkan-layers libgcc; \
else \
apk add --no-cache libgomp vulkan-tools mesa-vulkan-ati mesa-vulkan-intel mesa-vulkan-layers libgcc; \
fi
WORKDIR /app
COPY --from=apibuilder /app/miyo .
COPY --from=apibuilder /app/out out/
Expand Down

0 comments on commit 0c7e1a9

Please sign in to comment.