...
Docker can be installed as described in the installation notes on docker.com.
Set up the repository
update apt package index and install prerequisites
| Code Block |
|---|
sudo apt-get update |
| Code Block |
|---|
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common |
Add Docker's official GPG key
| Code Block |
|---|
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - |
Add stable arm64 repository for debian10
| Code Block |
|---|
sudo add-apt-repository \ "deb [arch=arm64] https://download.docker.com/linux/debian \ $(lsb_release -cs) \ stable" |
...
| Code Block |
|---|
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy |
Install Docker engine
| Code Block |
|---|
sudo apt-get update |
| Code Block |
|---|
sudo apt-get install docker-ce docker-ce-cli containerd.io |
Done - installation can be verified by running the hello world docker container:
| Code Block |
|---|
sudo docker run hello-world |
...
This is the contents of a working docker-compose.yml file that sets up a wordpress webserver that depends on a mariadb database.
| Code Block |
|---|
version: '2'
services:
db:
image: mariadb
volumes:
- ./data/db/:/var/lib/mysql
restart: always
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: wproot
MYSQL_DATABASE: wordpress
MYSQL_USER: wpuser
MYSQL_PASSWORD: wppass
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8080:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wpuser
WORDPRESS_DB_PASSWORD: wppass
working_dir: /var/www/html
volumes:
- ./data/wordpress:/var/www/html/wp-content |
...
Alternatively a docker-compose file can be used to deploy portainer:
| Code Block |
|---|
version: '2'
services:
portainer:
image: portainer/portainer
command: -H unix:///var/run/docker.sock
restart: always
ports:
- 9000:9000
- 8000:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
volumes:
portainer_data: |
The portainer UI will be available at http://localhost:9000.