2022-05-18 20:35:51 +08:00
|
|
|
FROM node:16 as js-build
|
|
|
|
WORKDIR /gotty
|
|
|
|
COPY js /gotty/js
|
|
|
|
COPY Makefile /gotty/
|
|
|
|
RUN make bindata/static/js/gotty.js.map
|
2020-02-28 20:43:17 +08:00
|
|
|
|
2022-05-18 20:35:51 +08:00
|
|
|
FROM golang:1.16 as go-build
|
2020-02-28 20:43:17 +08:00
|
|
|
WORKDIR /gotty
|
|
|
|
COPY . /gotty
|
2022-05-18 20:35:51 +08:00
|
|
|
COPY --from=js-build /gotty/js/node_modules /gotty/js/node_modules
|
|
|
|
COPY --from=js-build /gotty/bindata/static/js /gotty/bindata/static/js
|
2020-02-28 20:43:17 +08:00
|
|
|
RUN CGO_ENABLED=0 make
|
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
RUN apk update && \
|
|
|
|
apk upgrade && \
|
2022-05-18 20:35:51 +08:00
|
|
|
apk --no-cache add ca-certificates bash
|
2020-02-28 20:43:17 +08:00
|
|
|
WORKDIR /root
|
2022-05-18 20:35:51 +08:00
|
|
|
COPY --from=go-build /gotty/gotty /usr/bin/
|
2020-02-28 20:43:17 +08:00
|
|
|
CMD ["gotty", "-w", "bash"]
|