Add gitlab action steps to build and push docker
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,15 +1,20 @@
|
||||
FROM golang:1.16
|
||||
FROM node:16 as js-build
|
||||
WORKDIR /gotty
|
||||
COPY js /gotty/js
|
||||
COPY Makefile /gotty/
|
||||
RUN make bindata/static/js/gotty.js.map
|
||||
|
||||
FROM golang:1.16 as go-build
|
||||
WORKDIR /gotty
|
||||
COPY . /gotty
|
||||
COPY --from=js-build /gotty/js/node_modules /gotty/js/node_modules
|
||||
COPY --from=js-build /gotty/bindata/static/js /gotty/bindata/static/js
|
||||
RUN CGO_ENABLED=0 make
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk update && \
|
||||
apk upgrade && \
|
||||
apk --no-cache add ca-certificates && \
|
||||
apk add bash
|
||||
apk --no-cache add ca-certificates bash
|
||||
WORKDIR /root
|
||||
COPY --from=0 /gotty/gotty /usr/bin/
|
||||
COPY --from=go-build /gotty/gotty /usr/bin/
|
||||
CMD ["gotty", "-w", "bash"]
|
||||
|
||||
Reference in New Issue
Block a user