我正在尝试实现一个 Dockerfile 来包含我的 go 二进制文件和 chromedp。我设法构建了映像,并且可以运行映像,并且 go 二进制文件按预期运行,除了 chromedp。
提前致谢!
我收到的错误消息:
Error exec: "google-chrome": executable file not found in $PATH running chromedp
Dockerfile
# syntax=docker/dockerfile:1
##
## Build
##
FROM golang:1.17-bullseye as build
WORKDIR /app
COPY . ./
RUN go mod download
COPY *.go ./
RUN go build -o /docker-scraper
EXPOSE 8080
FROM chromedp/headless-shell:latest
CMD ["/docker-scraper"]
##
## Deploy
##
FROM gcr.io/distroless/base-debian11
WORKDIR /
COPY --from=build /docker-scraper /docker-scraper
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT ["/docker-scraper"]
侃侃无极
相关分类