我在Windows上有gcc。
C:\Users\jkrov>gcc --version
gcc (MinGW.org GCC-8.2.0-5) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
我的Docker文件:
FROM golang:alpine
RUN mkdir /app
WORKDIR /app
ADD . /app
RUN go build -o main .
EXPOSE 8080
CMD [ "app/main" ]
当我尝试构建图像时出现错误:
exec: "gcc": executable file not found in $PATH