How do I run Geth from a docker container?

There is a simpler way this can be done using a Docker client. This is a guide for running the GETH (Ethereum-Go) node client from inside a Docker container. GETH is the GoLang implementation of the Ethereum protocol. There is an image available to pull from the Docker hub repository that can run the environment.

What is a docker image?

A Docker image with recent snapshot builds from our develop branch is maintained on DockerHub to support users who prefer to run containerized processes. There four different Docker images available for running the latest stable or development versions of Geth. ethereum/client-go:latest is the latest development version of Geth (default)

What does -d do in Docker?

The -d flag makes the Docker CLI detach from the container, allowing it to run in the background. A port mapping is defined with -p, so port 8080 on your host maps to port 80 in the container. You should see your web page if you visit localhost:8080 in your browser. Docker images are formed from layers.

Can a docker container run on Linux?

Containers can only run if you have the Docker client installed. Depending on your operating system, the correct version of the client will be needed. There are separate versions for Windows, Linux and the MacOS. The container can even be run on a Linux instance running on AWS, like a typical Linux installation.