Docker on a Chromebook on Crostini - Neverware CloudReady is ready
Chrome OS is not just for kids and coffee tables. It can provide a useful Linux platform too.
Crostini brings a secure linux environment to Chrome OS. Sophisticated development and deployments can be created with Docker containers running inside in this environment. Chrome OS is capable of running Anaconda, Jupyter notebooks and other containers on many different developer machines. I run CloudReady Chrome OS on a Dell E7x40 to great effect.
Dynamic DNS entries for penguin/crostini/docker exist in /etc/hosts at the crosh prompt. The address in /etc/hosts can be used by chrome to make a connection to the docker apps exposed ports
Docker container ports are exposed on a network visible to Crostini and thus to Crosh and
Crostini brings a secure linux environment to Chrome OS. Sophisticated development and deployments can be created with Docker containers running inside in this environment. Chrome OS is capable of running Anaconda, Jupyter notebooks and other containers on many different developer machines. I run CloudReady Chrome OS on a Dell E7x40 to great effect.
References
- Chromebook firebase setup guide
- Cloud Ready running Docker without Crostini or VirtualBox
- Crostini forums on reddit
- Install docker-compse on Ubuntu
- Run Linux programs on ChromeBook with Crostini
- Hackernoon Pixelbook Revisited: Running Docker Containers
- Running the shell and connecting Chrome to docker apps
Install and run Docker in Crostini
All testing was done on CloudReady running on a Dell E7240. I was able to run anaconda/Python and other docker-compose using docker-compose.yml files my github that I had built for Mac and PC. The steps update docker to the latest ce version and docker-compose to the latest version available at this time, 1.24.0.Step | Action |
---|---|
Enable Linux (Beta) AKA Crostini | |
Enable Linux Beta | Menu --> settings -- Linux (Beta) |
Open Linux Terminal | Enable Linux Beta |
Install / upgrade docker | |
Remove old docker | sudo apt remove docker docker-engine docker.io containerd runc |
Install Docker | sudo apt update sudo apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/debian \ $(lsb_release -cs) \ stable" sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io |
Enable non-root docker | sudo usermod -aG docker $USER sudo chmod 666 /var/run/docker.sock |
Verify docker | docker run ps docker run hello-world |
Upgrade docker-compose | |
Remove old docker-compose | sudo apt remove docker-compose |
Install docker-compose | sudo curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose |
Verify docker-compose | docker-compose --version |
Connecting Chrome to exposed Docker endpoints | |
Try DNS / hostname | Point Chrome at http://penguin.linux.test:<port_address>/<url>
|
IP Address | Point Chrome at http://<that_ip>:<port_address>/<url>
|
Connecting Chrome to exposed Docker apps
Docker runs in/on the Penguin container. The Penguin container is visible to Crosh and Chrome as an IP address. Docker processes can expose ports to their host, Penguin/Crostini in this case. This means Docker exposes the to Chrome or Crosh on the Penguin container IP address.Dynamic DNS entries for penguin/crostini/docker exist in /etc/hosts at the crosh prompt. The address in /etc/hosts can be used by chrome to make a connection to the docker apps exposed ports
Docker container ports are exposed on a network visible to Crostini and thus to Crosh and
Sophisticated Capabilities
Here is the deployment topology on my machine after deploying a couple of services on Docker on Crostini on Termina on a Chromebook running CloudReady.
|
Visual Studio Code integration.
Visual Studio Code runs on Chromebooks on Crostini where it can be used to develop code and manage/view Docker containers. The VSCode Docker Extension lets you manage docker images and processes using the Visual Studio GUI.Video Demonstration
Neverware native Docker with Flatpack
Never home edition can run Docker containers without or outside of the Crostini environment. It lets users run Flatpack docker applications. This configuration only exists on CloudReady home and is not a standard Chromebook feature.
Change Log
Created 2020 03
Fantastic work! Thank you.
ReplyDeletewell documented. Works!
ReplyDeleteexcellent, thanks!
ReplyDeleteone minor correction - i think "docker run ps" should be "docker ps"
Than you for this information. Why with the installation of DynamoDB Local (Amazon image) with Docker, the URL http: //localhost: 8000/shell is OK and this one http: //localhost:8000 returns an error ERR_INVALID_RESPONSE?
ReplyDelete