Run Google Chrome On a Docker Container Using –env="DISPLAY"

  docker, google-chrome, linux-mint, ubuntu-20.04

I am using Linux Mint 20.2

I used the following commands to install google chrome on ubuntu 20.04 image.

$ sudo docker run -it --name os2 --env="DISPLAY" ubuntu:20.04
[email protected]:/# apt update
[email protected]:/# apt install wget
[email protected]:/# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
[email protected]:/# apt install ./google-chrome-stable_current_amd64.deb

Just to be clear, I need to use chrome with the GUI. That is why I used --env="DISPLAY". However, when I try to run google chrome using google-chrome --no-sandbox it gives the following error.

[email protected]:/# google-chrome --no-sandbox
[5970:5970:0917/200945.869861:ERROR:browser_main_loop.cc(1409)] Unable to open X display.
[email protected]:/# [0917/200945.875520:ERROR:nacl_helper_linux.cc(307)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

What can be the solution to run google chrome inside docker?

Source: Docker Questions

LEAVE A COMMENT