增加做镜像的脚本

This commit is contained in:
somunslotus 2025-03-31 17:27:23 +08:00
parent 5bb5ca67e9
commit b4e1e31e31
2 changed files with 12 additions and 3 deletions

View File

@ -1,4 +1,4 @@
FROM node:18-alpine as nodebuilder
FROM 172.20.32.187/tempimagefile/node:18-alpine as nodebuilder
LABEL stage=nodebuilder
# Set the working directory to /app
WORKDIR /web
@ -7,6 +7,7 @@ COPY package.json /web/
# Install any needed packages
RUN npm cache clear --force
RUN npm config set registry https://registry.npmmirror.com/
RUN npm install
COPY . /web/
@ -14,7 +15,7 @@ COPY . /web/
ENV NODE_OPTIONS=--max_old_space_size=2048
RUN npm run build
FROM golang:1.21-alpine AS gobuilder
FROM 172.20.32.187/tempimagefile/golang:1.21-alpine AS gobuilder
LABEL stage=gobuilder
@ -29,7 +30,7 @@ RUN go mod download
RUN apk add build-base
RUN go build -ldflags="-s -w" -o /server/server /server/api/studio/studio.go
FROM alpine
FROM 172.20.32.187/tempimagefile/alpine:latest
WORKDIR /app
COPY --from=gobuilder /server/server /app/server

8
build-image.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
tag=$(date +%Y%m%d%H%M%S)
image=172.20.32.187/pipeline-service/nebula-graph-studio:${tag}
docker build -t ${image} .
docker push image