-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (28 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM ubuntu AS builder
RUN apt update -y
RUN apt upgrade -y
RUN apt install -y locales
RUN apt install -y sudo
RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
echo "LANG=en_US.UTF-8" > /etc/locale.conf && \
locale-gen en_US.UTF-8
RUN useradd -m -G sudo developer
RUN echo 'developer:developer' | chpasswd
USER developer
RUN echo developer | sudo -S DEBIAN_FRONTEND="noninteractive" apt install -y golang
RUN echo developer | sudo -S apt install -y ca-certificates && sudo update-ca-certificates
RUN echo developer | sudo -S apt install -y make git vim protobuf-compiler
ENV GOPATH /home/developer/go
ENV PATH $PATH:/home/developer/go/bin
COPY . /home/developer/go/src/github.com/ozoncp/ocp-tip-api
RUN echo developer | sudo -S chown -R developer /home/developer/
WORKDIR /home/developer/go/src/github.com/ozoncp/ocp-tip-api
RUN make deps && make build
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /home/developer/go/src/github.com/ozoncp/ocp-tip-api/bin/ocp-tip-api .
RUN chown root:root ocp-tip-api
EXPOSE 82 8081 9100
CMD ["./ocp-tip-api"]