mirror of
https://github.com/1Panel-dev/KubePi.git
synced 2025-09-26 19:31:15 +08:00
build(docker): 增加docker镜像
This commit is contained in:
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
**/node_modules
|
40
Dockerfile
Normal file
40
Dockerfile
Normal file
@@ -0,0 +1,40 @@
|
||||
FROM node:14-alpine as stage-web-build
|
||||
|
||||
LABEL stage=stage-web-build
|
||||
|
||||
RUN apk add make
|
||||
|
||||
WORKDIR /build/ekko/web
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN make build_web
|
||||
|
||||
|
||||
FROM golang:1.16 as stage-bin-build
|
||||
|
||||
ENV GOPROXY="https://goproxy.cn,direct"
|
||||
|
||||
LABEL stage=stage-bin-build
|
||||
|
||||
WORKDIR /build/ekko/bin
|
||||
|
||||
COPY --from=stage-web-build /build/ekko/web .
|
||||
|
||||
ENV GO111MODULE=on
|
||||
|
||||
RUN go mod download
|
||||
|
||||
RUN make build_all
|
||||
|
||||
FROM alpine:3.14
|
||||
|
||||
WORKDIR /
|
||||
|
||||
COPY --from=stage-bin-build /build/ekko/dist/usr /usr
|
||||
|
||||
EXPOSE 2019
|
||||
|
||||
USER root
|
||||
|
||||
CMD ["ekko-server"]
|
6
Makefile
6
Makefile
@@ -5,7 +5,7 @@ GOARCH=$(shell go env GOARCH)
|
||||
GOOS=$(shell go env GOOS )
|
||||
|
||||
BASEPATH := $(shell pwd)
|
||||
BUILDDIR=$(BASEPATH)/dist/bin
|
||||
BUILDDIR=$(BASEPATH)/dist/usr/local/bin
|
||||
EKKODIR=$(BASEPATH)/web/ekko
|
||||
DASHBOARDDIR=$(BASEPATH)/web/dashboard
|
||||
TERMINALDIR=$(BASEPATH)/web/terminal
|
||||
@@ -13,7 +13,7 @@ TERMINALDIR=$(BASEPATH)/web/terminal
|
||||
|
||||
MAIN= $(BASEPATH)/cmd/server/main.go
|
||||
|
||||
APP_NAME=ekko
|
||||
APP_NAME=ekko-server
|
||||
|
||||
GOPROXY="https://goproxy.cn,direct"
|
||||
|
||||
@@ -28,3 +28,5 @@ build_web: build_web_ekko build_web_dashboard build_web_terminal
|
||||
|
||||
build_bin:
|
||||
GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags "-s -w" -o $(BUILDDIR)/$(GOOS)/$(GOARCH)/$(APP_NAME) $(MAIN)
|
||||
|
||||
build_all: build_web build_bin
|
||||
|
@@ -29,7 +29,7 @@ func init() {
|
||||
}
|
||||
|
||||
var RootCmd = &cobra.Command{
|
||||
Use: "ekko",
|
||||
Use: "ekko-server",
|
||||
Short: "A dashboard for kubernetes",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
server.EmbedWebDashboard = embedWebDashboard
|
||||
|
Reference in New Issue
Block a user