1、docker in can not run

This commit is contained in:
redhat 2025-05-22 09:42:31 +08:00
parent de5f51e9dc
commit 7ad3d0487c
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,7 @@
FROM golang:alpine AS builder
RUN apk update && apk add gcc g++
# 为我们的镜像设置必要的环境变量
ENV GO111MODULE=on \
GOPROXY=https://goproxy.cn,direct \
@ -14,7 +16,7 @@ WORKDIR /build
COPY . .
# 将我们的代码编译成二进制可执行文件 app
RUN go mod tidy && go build -o dash .
RUN go mod tidy && CGO_ENABLED=1 go build -o dash .
###################
# 接下来创建一个小镜像

View File

@ -26,6 +26,7 @@ services:
- "8967:8080"
volumes:
- ./stack/data/app:/var/www/html:z
- ./stack/data/sqlite:/app/data/sqlite:z
environment:
- MYSQL_HOST=mysql
- REDIS_HOST=redis