Run container as user

This commit is contained in:
nemunaire 2022-01-06 11:07:57 +01:00
parent 86676c61e5
commit 1c55277edf
2 changed files with 7 additions and 5 deletions

View File

@ -9,7 +9,7 @@ platform:
steps:
- name: build
image: golang:latest
image: golang:1
commands:
- apt-get update && apt-get install -y build-essential git go-bindata
- go generate -v

View File

@ -1,4 +1,4 @@
FROM golang:latest as gobuild
FROM golang:1 as gobuild
RUN apt-get update && \
apt-get install -y build-essential git go-bindata
@ -7,9 +7,9 @@ WORKDIR /go/src/git.nemunai.re/chldapasswd
ADD . .
RUN go generate -v
RUN go get -d -v
RUN go build -v
RUN go generate -v && \
go get -d -v && \
go build -v
FROM debian:stable-slim
@ -20,6 +20,8 @@ RUN apt-get update && \
EXPOSE 8080
USER nobody
WORKDIR /srv
ENTRYPOINT ["/srv/chldapasswd", "-bind=:8080"]