Skip to content

Commit

Permalink
Merge pull request #99 from grafana/build-fixuid
Browse files Browse the repository at this point in the history
Build fixuid
  • Loading branch information
pablochacin authored Jul 4, 2024
2 parents 17acb7a + ac39051 commit f176e07
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
ARG GO_VERSION=1.21.6
ARG VARIANT=alpine3.18

ARG GO_VERSION=1.22.4
ARG VARIANT=alpine3.20
FROM golang:${GO_VERSION}-${VARIANT} as builder

WORKDIR /build

COPY . .

ARG GOFLAGS="-ldflags=-w -ldflags=-s"
ARG FIXUID_VERSION=v0.6.0
RUN CGO_ENABLED=0 go build -o xk6 -trimpath ./cmd/xk6/main.go

RUN CGO_ENABLED=0 GOBIN=/build go install github.com/boxboat/fixuid@${FIXUID_VERSION}

FROM golang:${GO_VERSION}-${VARIANT}

COPY --from=builder /build/fixuid /usr/local/bin/

RUN addgroup --gid 1000 xk6 && \
adduser --uid 1000 --ingroup xk6 --home /home/xk6 --shell /bin/sh --disabled-password --gecos "" xk6

ARG FIXUID_VERSION=0.6.0
RUN USER=xk6 && \
GROUP=xk6 && \
wget -q -O - https://github.com/boxboat/fixuid/releases/download/v${FIXUID_VERSION}/fixuid-${FIXUID_VERSION}-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - && \
chown root:root /usr/local/bin/fixuid && \
chmod 4755 /usr/local/bin/fixuid && \
mkdir -p /etc/fixuid && \
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml

Expand Down

0 comments on commit f176e07

Please sign in to comment.