Open fqassemi opened 8 months ago
@fqassemi Thank you. I experienced the same issue. Will try your fix.
Verdict: It works.
The fixed Dockerfile may be found here: https://github.com/fqassemi/browsh/tree/docker-fix
To build and run the fixed Dockerfile:
docker build -t browsh .
docker run -it browsh https://www.google.com
I started building docker image on my debian version 11.9 and it failed times.
1) It returned an error failing to download go 2) it returned an error regarding missing browsh.xpi 3) it returned an error failing to change /etc/hosts
The fixes are :
1) I changed url=https://dl.google.com/go/go"$version".linux-"$GOARCH".tar.gz to url=https://go.dev/dl/go"$version".8.linux-"$GOARCH".tar.gz
2) I added the following commands to docker so it downloads and remove the browsh.xpi to the right directory (the lines between ): RUN /build/ctl.sh install_golang $BASE RUN wget -P "$BASE" "https://github.com/browsh-org/browsh/releases/download/v1.8.3/browsh-1.8.3.xpi" RUN mv "$BASE/browsh-1.8.3.xpi" "$BASE/src/browsh/browsh.xpi"** RUN /build/ctl.sh build_browsh_binary $BASE
3) Finally, instead of chaning /etc/hosts in the image, I changed it on the run: RUN echo 'curl -o /etc/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts' >> /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]
I will fix the error and make a pull request, but people can use this until then. The above instruction also fixed some other issues reported failing to build.