Skip to content

Commit

Permalink
build fixuid binary in image
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
  • Loading branch information
pablochacin committed Jun 18, 2024
1 parent eff8765 commit ac39051
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ 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 ac39051

Please # to comment.