error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.
failed to build, error: exit status 1
running...
/bin/sh: /src/tmp/main: not found
error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.
我的 docker 配置
FROM golang:1.19.2-alpine
RUN apk update && apk upgrade && \
apk add git make curl openssh-client
# Add a work directory
WORKDIR /src
# Install air for development
RUN curl -fLo install.sh https://raw.githubusercontent.com/cosmtrek/air/master/install.sh \
&& chmod +x install.sh && sh install.sh && cp ./bin/air /bin/air
# Start app
CMD air start
在我的代码中使用 air 重新加载
通过运行 go mod vendor 确保必要的依赖项已正确安装,并且您使用的是稳定版本的 go (1.17) 和 alpine (3.16)。