我正在嘗試將 docker 與 go lang 和 PostgreSQL 一起使用我有這個項(xiàng)目結(jié)構(gòu):-project_name - src - app - config - main.go - .env - docker-compose.yml - Dockerfiledocker-compose.yml 文件包含(我需要 GO 服務(wù)器和 PostgreSQL)version: '3.9'services: app: container_name: logger_app build: .. ports: - "12000:12000" restart: on-failure volumes: - .:/app depends_on: - postgres networks: - MYAPP postgres: image: postgres:latest container_name: postgres_db environment: - POSTGRES_USER=${DB_USER} - POSTGRES_PASSWORD=${DB_PASSWORD} - POSTGRES_DB=${DB_NAME} - DATABASE_HOST=${DB_HOST} ports: - '5432:5432' networks: - MYAPPnetworks: MYAPP: driver: bridgeDockerfile 包含:FROM golang:1.18 as builderRUN mkdir /appWORKDIR /appCOPY . .RUN go get -d -v ./...RUN go install -v ./...RUN go build -o /buildEXPOSE 12000CMD [ "/build" ]當(dāng)我運(yùn)行 docker-compose up --build 我得到這個錯誤:failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount868285600/Dockerfile: no such file or directoryERROR: Service 'app' failed to build : Build failed
添加回答
舉報
0/150
提交
取消