Seismology-Docker is a docker image with seismology-related packages installed.
- Docker with BuildKit
- X Server (for GUI support on Windows and macOS)
- For Windows,
VcXsrv
orMobaXterm
. - For Linux, it is installed by default on most of Linux distributions.
- For macOS,
XQuartz
.
- For Windows,
- xhost
- For Windows, it is part of
VcXsrv
. - For Arch-based distros,
xorg-xhost
. - For Debian-based distros,
x11-server-utils
. - For macOS, it is part of
XQuartz
.
- For Windows, it is part of
Note
If you have MobaXterm installed, you don't need to install VcXsrv.
- Download and install latest version of VcXsrv.
- Make sure that
Full
dropdown selected and clickNext
. - Leave the Destination Folder untouched and click
Install
. - After the installation process successfully completes you may click
Close
. - Configure VcXsrv with the application named
XLaunch
. - Make sure that
Multiple windows
option selected. - Set
Display number
to0
and clickNext
. - Make sure that
Start no client
option selected and clickNext
. - Select
Disable access control
option and clickNext
. - Click
Finish
. - Now you should see an
X icon
appears on your taskbar.
This indicates that the VcXsrv (X Server) is running.
Note
If you killed the X Server or the X icon disappeared from the taskbar, just relaunch XLaunch
and follow the configuration steps.
- Download and install latest version of Docker Desktop for Windows.
- Make sure that
Use WSL 2 instead of Hyper-V
option selected and clickOk
. - After the installation process successfully completes you may click
Close
. - Reboot the PC.
- Launch
Docker Desktop
. - Read the terms and conditions completely and click
Accept
. - Click
Continue without signing in
. - Click
Skip survey
. - Now you should see an
Docker icon
appears on your taskbar.
This indicates that the Docker Desktop (with Docker Engine) is running. - You may close Docker Desktop window when you confirm that Docker Desktop is running on the taskbar icon.
Note
If you killed the Docker Desktop or the Docker icon disappeared from the taskbar, just relaunch Docker Desktop
.
- Download and install latest version of XQuartz.
- Click
Continue
. - Read the information carefully and click
Continue
. - Read the terms and conditions carefully and click
Continue
. - Click
Agree
. - Click
Install
. - After the installation process successfully completes you may click
Close
. - Reboot the PC.
- Open Terminal.
# Enable Indirect GLX
$ defaults write org.xquartz.X11 enable_iglx -boolean true
# Allow connections from network
$ defaults write org.xquartz.X11 nolisten_tcp -boolean false
- Reboot the PC.
Important
Make sure that the Docker Engine is running before issuing docker
command.
- Run PowerShell.
# Download this repository
PS > iwr 'https://github.com/yurical/seismology-docker/archive/refs/heads/main.zip' -OutFile '.\seismology-docker.zip'
PS > Expand-Archive '.\seismology-docker.zip' .
PS > cd seismology-docker-main
# Go to the directory where you cloned repository or extracted `seismology-docker.zip`.
PS > cd seismology-docker
# Make sure that `Dockerfile` exists in the current directory
PS > Get-ChildItem
Directory: ...
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- ... ... Dockerfile
-a--- ... ... LICENSE
-a--- ... ... README.md
-a--- ... ... requirements.txt
# Build a docker image
PS > docker buildx build . --network host --tag seismology
[+] Building 137.1s (13/13) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> [internal] load .dockerignore 0.0s
=> [1/7] FROM docker.io/library/python:3.10-slim-bookworm@sha256:e53bad75661571d23d9fd632d10f192b09228f31b14af1f 7.7s
=> [2/7] RUN apt-get update 2.8s
=> [3/7] RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q dbus pkg-config libxcb*-dev l 71.6s
...
=> => naming to docker.io/library/seismology 0.0s
View build details: ...
# Once build finishes, make sure that `seismology` docker image exists
PS > docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
seismology latest ... ... <about a few GB>
Important
Make sure that the docker.service is running before issuing docker
command.
# Clone this repository
# or you can just download code archive from https://github.com/yurical/seismology-docker/archive/refs/heads/main.zip and extract it.
$ git clone https://github.com/yurical/seismology-docker.git
Cloning into 'seismology-docker'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 8 (delta 0), reused 8 (delta 0), pack-reused 0
Receiving objects: 100% (8/8), 4.42 KiB | 4.42 MiB/s, done.
# Go to the directory where you extracted `seismology-docker.zip`
$ cd seismology-docker
# Make sure that `Dockerfile` exists in the current directory
$ ls
Dockerfile LICENSE README.md requirements.txt
# Build a docker image
$ docker buildx build . --network host --tag seismology
[+] Building 137.1s (13/13) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> [internal] load .dockerignore 0.0s
=> [1/7] FROM docker.io/library/python:3.10-slim-bookworm@sha256:e53bad75661571d23d9fd632d10f192b09228f31b14af1f 7.7s
=> [2/7] RUN apt-get update 2.8s
=> [3/7] RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q dbus pkg-config libxcb*-dev l 71.6s
...
=> => naming to docker.io/library/seismology 0.0s
View build details: ...
# Once build finishes, make sure that `seismology` docker image exists
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
seismology latest ... ... <about a few GB>
Important
Make sure that the X Server and Docker Engine is running before issuing docker
command.
# Start the docker container with bash entrypoint
PS > docker run -e DISPLAY="host.docker.internal:0.0" --shm-size 4G -it --rm --entrypoint bash seismology
# Now it continues on bash as root
root@67ce68476fdc:/work#
# Run some applications to confirm GUI works
root@67ce68476fdc:/work# geany
# Type exit to quit from container
root@67ce68476fdc:/work# exit
PS >
# Adjust the permissions the X server host
$ xhost +local:docker
# Start the docker container with bash entrypoint
$ docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY --shm-size 4G -it --rm --entrypoint bash seismology
# Now it continues on bash as root
root@67ce68476fdc:/work#
# Run some applications to confirm GUI works
root@67ce68476fdc:/work# geany
# Type exit to quit from container
root@67ce68476fdc:/work# exit
$
# You can revert the permissions after you are finished using the container (If you concerned)
$ xhost -local:docker
# Create a docker group
$ sudo groupadd -f docker
# Add docker group to the current user
$ sudo usermod -aG docker "${USER}"
# Change /var/run/docker.sock owner group
$ sudo chown root:docker /var/run/docker.sock
# Apply the changes to groups
$ newgrp docker
# Restart the docker service
$ sudo systemctl restart docker
E: Failed to fetch http://deb.debian.org/debian/pool/main/*.deb Cannot initiate the connection to deb.debian.org:80. - connect (101: Network is unreachable)
Try the build command again.
- Add further instructions for macOS