有没有人在通过 docker 安装和使用 air 时遇到过这个错误?

问题描述 投票:0回答:1
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 重新加载

docker air
1个回答
0
投票

通过运行 go mod vendor 确保必要的依赖项已正确安装,并且您使用的是稳定版本的 go (1.17) 和 alpine (3.16)。

© www.soinside.com 2019 - 2024. All rights reserved.