第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

嘗試在 Docker 中運(yùn)行 Go Echo 應(yīng)用時(shí)出現(xiàn)模塊路徑問題

嘗試在 Docker 中運(yùn)行 Go Echo 應(yīng)用時(shí)出現(xiàn)模塊路徑問題

Go
慕哥6287543 2022-08-01 16:34:16
我遇到了一個(gè)奇怪的問題來運(yùn)行Go Echo框架。當(dāng)我使用該命令時(shí),它工作正常,這不是依賴問題,它正確執(zhí)行文件,但在運(yùn)行時(shí)它給出錯(cuò)誤:docker rundocker-compose upCreating echo_app ... doneAttaching to echo_appecho_app | server.go:6:2: cannot find package "github.com/labstack/echo/v4" in any of:echo_app |  /usr/local/go/src/github.com/labstack/echo/v4 (from $GOROOT)echo_app |  /go/src/github.com/labstack/echo/v4 (from $GOPATH)echo_app exited with code 1以下是我的文件:DockerfileFROM golang:1.15-alpineLABEL maintainer="Me"RUN apk updateRUN apk add git# Setting up Dev environmentRUN mkdir /echo_appCOPY . /echo_app/WORKDIR /echo_app/# Download Echo Framework with help of Go mod (Credit: https://github.com/labstack/echo/issues/1374#issuecomment-559990790)# Init to create Go ModuleRUN go mod init app.com/main# Building to download echo framework and other dependenciesRUN go build# RUN the server#CMD go run server.go EXPOSE 1323docker-compose.ymlversion: "3"services:   web:    container_name: echo_app    image: echo_app:latest    build: ./    command: go run server.go    volumes:      - .:/echo_app    ports:       - "1323:1323"
查看完整描述

1 回答

?
富國滬深

TA貢獻(xiàn)1790條經(jīng)驗(yàn) 獲得超9個(gè)贊

FROM golang:1.15-alpine

LABEL maintainer="Me"



# Setting up Dev environment


WORKDIR /echo_app/

# note this file, go.mod exists locally. and contain reference 

# to direct/indirect dependencies. this step allows to download 

# dependencies and speedup build for docker images (if it used 

# to build artifacts, and not as dev env).  

COPY go.mod  /echo_app/go.mod

RUN go mod download



EXPOSE 1323


查看完整回答
反對(duì) 回復(fù) 2022-08-01
  • 1 回答
  • 0 關(guān)注
  • 92 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)