当我使用Dockerfile构建二进制文件并将其打包为用于气流导出器的高山图像时,出现错误。
不确定如何解决此错误。
+++++码头工人建造时发生错误+++++++++
---> Running in caebfe9a04a0
stat mage.go: no such file or directory
The command '/bin/sh -c cd /go/src/github.com/airflow_exporter/; go run mage.go binary' returned a non-zero code: 1
+++++++++++++++++
++++++++++++++++我的Dockerfile +++++++++++++++++
FROM golang:1.11.1 AS builder
RUN mkdir -p /go/src/github.com/airflow_exporter
ADD . /go/src/github.com/airflow_exporter
RUN cd /go/src/github.com/airflow_exporter/;
go run mage.go binary
FROM alpine:3.4
COPY --from=builder /go/src/github.com/airflow_exporter/bin/*/airflow_exporter /airflow_exporter
EXPOSE 9112
ENTRYPOINT [ "/airflow_exporter" ]
++++++++++++++++++++++++++++++++++
答案 0 :(得分:1)
docker build输出中的第一行显示二进制文件mage.go不在预期的位置(状态mage.go:没有此类文件或目录)。检查完成导致读取该二进制文件的步骤。我将浏览以下内容: