Fix image
This commit is contained in:
parent
12f94aeb74
commit
893d85d3c6
11
Dockerfile
11
Dockerfile
|
@ -2,16 +2,17 @@ FROM golang:alpine
|
|||
|
||||
COPY src /go/src/github.com/tiagoapimenta/nginx-ldap-auth
|
||||
|
||||
RUN cd /go/src/github.com/tiagoapimenta/nginx-ldap-auth &&
|
||||
go get -u gopkg.in/yaml.v2 &&
|
||||
go get -u gopkg.in/ldap.v2 &&
|
||||
RUN cd /go/src/github.com/tiagoapimenta/nginx-ldap-auth && \
|
||||
apk add --no-cache git && \
|
||||
go get -u gopkg.in/yaml.v2 && \
|
||||
go get -u gopkg.in/ldap.v2 && \
|
||||
go build -ldflags='-s -w' -v -o /go/bin/nginx-ldap-auth .
|
||||
|
||||
FROM alpine
|
||||
|
||||
MAINTAINER Tiago A. Pimenta <tiagoapimenta@gmail.com>
|
||||
|
||||
COPY --from=0 /go/bin/nginx-ldap-auth/nginx-ldap-auth /usr/local/bin/nginx-ldap-auth
|
||||
COPY --from=0 /go/bin/nginx-ldap-auth /usr/local/bin/nginx-ldap-auth
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
|
@ -19,6 +20,6 @@ VOLUME /etc/nginx-ldap-auth
|
|||
|
||||
EXPOSE 5555
|
||||
|
||||
USER nouser
|
||||
USER nobody
|
||||
|
||||
CMD [ "nginx-ldap-auth", "--config", "/etc/nginx-ldap-auth/config.yaml" ]
|
||||
|
|
19
build
Executable file
19
build
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
image='docker.io/tpimenta/nginx-ldap-auth:latest'
|
||||
|
||||
atexit() {
|
||||
docker images -q -f dangling=true | xargs -r docker rmi
|
||||
}
|
||||
|
||||
trap atexit INT TERM EXIT
|
||||
|
||||
docker build \
|
||||
--force-rm \
|
||||
--no-cache \
|
||||
--tag "$image" \
|
||||
"$(dirname "$0")"
|
||||
|
||||
docker push "$image"
|
Reference in a new issue