forked from vmware-archive/octant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (35 loc) · 1.26 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
40
41
42
43
44
45
46
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# ------------------------------------------------------------------------------
# Build web assets
# ------------------------------------------------------------------------------
FROM node:10.15.3 as base
ADD web/ /web
WORKDIR /web
RUN npm ci && npm run-script build
# ------------------------------------------------------------------------------
# Install go tools and build binary
# ------------------------------------------------------------------------------
FROM golang:1.12 as builder
WORKDIR /workspace
ADD . /workspace
COPY --from=base /web ./web
ENV GOFLAGS=-mod=vendor GO111MODULE=on
RUN make go-install
RUN go generate ./web
RUN make octant-dev
# ------------------------------------------------------------------------------
# Running container
# ------------------------------------------------------------------------------
FROM ubuntu:bionic
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /workspace/build/octant /octant
RUN chmod +x /octant
RUN useradd -s /sbin/nologin -M -u 10000 -U user
USER user
VOLUME [ "/kube"]
EXPOSE 7777