mirror of
https://github.com/onyx-dot-app/onyx.git
synced 2026-10-19 01:50:51 -05:00
Co-authored-by: onyx-cherry-pick[bot] <285052878+onyx-cherry-pick[bot]@users.noreply.github.com> Co-authored-by: roshan <38771624+rohoswagger@users.noreply.github.com>
27 lines
832 B
Docker
27 lines
832 B
Docker
# Registry prefix for base images. Defaults to Docker Hub; CI overrides this to the ECR
|
|
# pull-through cache (<account>.dkr.ecr.us-east-2.amazonaws.com/docker-hub) to avoid Docker
|
|
# Hub rate limits.
|
|
ARG BASE_IMAGE_REGISTRY=docker.io
|
|
FROM ${BASE_IMAGE_REGISTRY}/library/golang:1.27.1-alpine@sha256:8a5910f31396cd4d89662f56c68b3ae31d374308270a1c3bd96672ee5ed43414 AS builder
|
|
|
|
WORKDIR /app
|
|
COPY ./ .
|
|
|
|
ARG TARGETARCH
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o onyx-cli .
|
|
RUN mkdir -p /home/onyx/.config
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
COPY --from=builder --chown=65534:65534 /home/onyx /home/onyx
|
|
|
|
COPY --from=builder /app/onyx-cli /onyx-cli
|
|
|
|
ENV HOME=/home/onyx
|
|
ENV XDG_CONFIG_HOME=/home/onyx/.config
|
|
|
|
USER 65534:65534
|
|
|
|
ENTRYPOINT ["/onyx-cli"]
|