Compare commits

..

2 Commits

Author SHA1 Message Date
d4a12f8205 Make go binaries lighter
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-19 15:57:45 +01:00
1c55277edf Run container as user 2022-02-19 15:57:45 +01:00
2 changed files with 8 additions and 6 deletions

View File

@ -9,12 +9,12 @@ 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
- go get -v -d
- go build -v -o chldapasswd
- go build -v -ldflags="-s -w" -o chldapasswd
- name: docker
image: plugins/docker

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 -ldflags="-s -w"
FROM debian:stable-slim
@ -20,6 +20,8 @@ RUN apt-get update && \
EXPOSE 8080
USER nobody
WORKDIR /srv
ENTRYPOINT ["/srv/chldapasswd", "-bind=:8080"]