Skip to content

Commit

Permalink
fix the broken symbol link for chrome bin
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Jul 1, 2021
1 parent 52c3253 commit f344c8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ WORKDIR /rod
RUN go env -w GO111MODULE=on && go env -w GOPROXY=$goproxy
RUN go build ./lib/launcher/rod-manager
RUN go run ./lib/utils/get-browser
RUN ln -s $(go run ./lib/utils/get-browser) /usr/bin/chrome

FROM ubuntu:bionic

ARG apt_sources="http://archive.ubuntu.com"

RUN ln -s /root/.cache/rod/chromium-869685/chrome-linux/chrome /usr/bin/chrome

RUN sed -i "s|http://archive.ubuntu.com|$apt_sources|g" /etc/apt/sources.list && \
apt-get update && \
apt-get install --no-install-recommends -y \
Expand All @@ -46,6 +45,7 @@ RUN sed -i "s|http://archive.ubuntu.com|$apt_sources|g" /etc/apt/sources.list &&
ENTRYPOINT ["dumb-init", "--"]

COPY --from=go /root/.cache/rod /root/.cache/rod
COPY --from=go /usr/bin/chrome /usr/bin/
COPY --from=go /rod/rod-manager /usr/bin/

CMD rod-manager
7 changes: 6 additions & 1 deletion lib/utils/get-browser/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package main

import (
"fmt"

"github.com/go-rod/rod/lib/launcher"
"github.com/go-rod/rod/lib/utils"
)

func main() {
utils.E(launcher.NewBrowser().Get())
p, err := launcher.NewBrowser().Get()
utils.E(err)

fmt.Println(p)
}

0 comments on commit f344c8b

Please sign in to comment.