elvish/Dockerfile
Qi Xiao ab2799ed00 Improve Dockerfile.
* Use multi-stage build to reduce image size.

* Run a user with sudo access instead of root.
2018-09-15 14:42:44 +01:00

15 lines
396 B
Docker

FROM golang:alpine as builder
RUN apk update && \
apk add --virtual build-deps make git
COPY . /go/src/github.com/elves/elvish
RUN make -C /go/src/github.com/elves/elvish get
FROM alpine
COPY --from=builder /go/bin/elvish /bin/elvish
RUN adduser -D elf
RUN apk update && apk add sudo && \
echo 'elf ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
USER elf
WORKDIR /home/elf
CMD ["/bin/elvish"]