CareyWang / MyUrls

Your Own URL Shortener
MIT License
304 stars 126 forks source link

docker版布署出错,大佬帮看看是什么问题 #28

Closed binhe-cpu closed 11 months ago

binhe-cpu commented 1 year ago

Status: Downloaded newer image for golang:1.20-alpine ---> 818ca3531f99 Step 2/13 : WORKDIR /app ---> Running in c44166717085 Removing intermediate container c44166717085 ---> df3135846e2a Step 3/13 : COPY main.go go.mod go.sum . When using COPY with more than one source file, the destination must be a directory and end with a / ERROR: Service 'myurls' failed to build

CareyWang commented 1 year ago

@binhe-cpu 可以先尝试升级下docker版本到最新,Docker version 23.0.3, build 3e7cbfd 暂时没复现

binhe-cpu commented 1 year ago

升级docker后布署成功了,可又出新问题了,生成短链失败 image

binhe-cpu commented 1 year ago

找到原因了,域名后面加了个/

weedsstars commented 1 year ago

Status: Downloaded newer image for golang:1.20-alpine ---> 818ca3531f99 Step 2/13 : WORKDIR /app ---> Running in c44166717085 Removing intermediate container c44166717085 ---> df3135846e2a Step 3/13 : COPY main.go go.mod go.sum . When using COPY with more than one source file, the destination must be a directory and end with a / ERROR: Service 'myurls' failed to build 这个报错把Dockerfile的第三行的COPY main.go go.mod go.sum .改成COPY main.go go.mod go.sum ./ 就好了

kissyouhunter commented 1 year ago

找到原因了,域名后面加了个/

我也碰到了同样的问题

我的设置 MYURLS_PORT=35202 MYURLS_DOMAIN=1uu.me MYURLS_TTL=180