commit ci file
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
loser 2022-06-15 11:43:40 +08:00
parent 2f91b44bb8
commit c011fe69c8
3 changed files with 16 additions and 8 deletions

View File

@ -11,7 +11,7 @@ steps:
image: plugins/docker
settings:
registry: registry.cn-shanghai.aliyuncs.com
repo: registry.cn-shanghai.aliyuncs.com/docker-echo
repo: registry.cn-shanghai.aliyuncs.com/docker-echo/docker
username:
from_secret: xs765911
password:

View File

@ -1,10 +1,17 @@
FROM golang:1.18 as builder
WORKDIR /build
WORKDIR /builder
COPY . .
RUN CGO_ENABLED=0 GOPROXY=https://proxy.golang.com.cn,direct go build -o demo
FROM alpine:3.10 as runner
LABEL description="the image is a demo"
RUN go mod download && go build -o app && upx -9 app
RUN ls -lh && chmod +x ./app
# 指定创建的基础镜像
FROM alpine as runner
# 替换阿里云的源
RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/main/" > /etc/apk/repositories
RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/community/" >> /etc/apk/repositories
WORKDIR /app
COPY --from=builder /build/demo /app/
EXPOSE 8080
ENTRYPOINT ["./demo"]
COPY --from=builder /builder/app ./app
CMD ./app

View File

@ -10,6 +10,7 @@ import (
//func init() {
// client.InitMySQLClient()
//}
func main() {
app := gin.Default()