Install Docker and Dockstation on Fedora
We will install Docker, Docker Compose and Dockstation on Fedora 34 using official guidelines and set up a pyspark-notebook image as an example.
So, let’s get started right away.
First switch to the root user:
su root
Alternatively, you can add sudo
before each following command.
Install Docker Engine on Fedora
Uninstall old versions
dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
Set up the repository
dnf -y install dnf-plugins-corednf config-manager \
--add-repo \
https://download.docker.com/linux/fedora/docker-ce.repo
Install Docker Engine
dnf install docker-ce docker-ce-cli containerd.io
Start Docker
systemctl start docker
Verify that Docker Engine is installed correctly
docker run hello-world
If everything is okay you will get similar output
Also, you can check the current docker version
docker version
Install Docker Compose
Download the current stable release of Docker Compose (1.29.2)
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Apply executable permissions to the binary
chmod +x /usr/local/bin/docker-compose
Test the installation
docker-compose --version
Manage Docker as a non-root user
usermod -aG docker $USER
Log out and log back in so that your group membership is re-evaluated.
Configure Docker to start on boot
systemctl enable docker.service
systemctl enable containerd.service
Install Dockstation
Download AppImage.
Mark the file as executable from the permissions tab in the file properties and launch by double-clicking the file.
After register or login, you will get this screen
As an example let’s install pyspark-notebook
provided by jupyter
.
Click the “Add new project “ button, set project title, create and select project path, optionally select the latest Compose file version
Click the “CREATE” button. You will be taken to the screen where you can find the images you need. On the “SCHEME” tab at the bottom in the “Search images” field type in “pyspark-notebook”
Find an image from ‘jupiter’ and drag it to the right
Click the “OK” button. Then you can click the “Start” button and you are ready for work.
By default, Jupiter notebook works on port 8888. In my case port was already in use by another Jupiter notebook launched with the Anaconda.
Check if the port is in use (if the port is not in use then the command will return nothing)
ss -tulpn | grep ':8888'
So we can change the port in Dockstation. Go to tab “General” -> “Settings” -> “Ports” and set local port to 9999, for example.
Click the “Start” button, go to the “Logs” tab, copy the URL at the bottom and paste it into the browser. If you change the port earlier — correct it in the URL
In case you need to use the local files (run your local .ipynb files for example), you may want to connect them as volumes.
This can be done in tab “General” -> “Settings” -> “Volumes”
Or add volumes directly to docker-compose.yml file in tab “Editor”
Then click the “Restart” button and you are good to go.
That it.