custom docker stuff
To speed up the install process there is an install script in tools
./tools/install.sh
./tools/loginDockerHub.sh
If you want to run a docker of a differnt architecture please install
sudo apt install -y qemu qemu-user-static binfmt-support
and spinn up the multiarch container
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
run init.sh to ensure the proper .env file is generated
./init.sh
in the folder snippets one can find different code snippets to copy into
docker-compose or
Dockerfile
to quickly setup a new project
sudo groupadd docker
sudo gpasswd -a $USER docker
sudo chown $USER:docker ~/.docker
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt-get purge docker-ce docker-ce-cli containerd.io
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo add-apt-repository \
"deb [arch=arm64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo apt install -y qemu qemu-user-static binfmt-support
(there is a script in tools for this as well) cat pw.txt | sudo docker login --username sausy --password-stdin install docker-compose
sudo apt install -y docker-compose
You could also specifiy the target architecture FROM --platform=linux/arm64 ubuntu:18.04
First you have to run
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
example: First build base arm img
cd arm64
docker build -t rpiarm64ros2:latest .
then build e.g. the one for meldoic (ros1)
cd melodic
docker build -t bionic/arm64:melodic .
to use buildx nano ~/.docker/config.json
{ "auths": { "https://index.docker.io/v1/": { "auth": "c2F1c3k6U2F1c2krMzIxXw==" } }, "HttpHeaders": { "User-Agent": "Docker-Client/18.09.7 (linux)" }, "experimental": true
}
sudo service docker restart
to run on different architecture
if docker buildx ls doesn't work just go into sudo service docker stop sudo dockerd --experimental
which should display alle the supportet architectures to use a specific architecture
docker run --rm ubuntu:18.04@sha256:214d66c966334f0223b036c1e56d9794bc18b71dd20d90abb28d838a5e7fe7f1 uname -m
if you don't want to log out and log in again use the hacky way su - $USER
#sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
sudo docker commit d32b2a73140 x64/ros2/dashing:latest
#Docker Compose To build multiple targets and also predefine names ... docker-compose.yml could be used therefore a docker-compose.yml file has to be created
version: ''
if you use docker compose eg do define the external interface to be accessible to the docker you must run
cd <PATH TO YOU docker-compose.yml>
docker-compose up
which builds everything and runs it
eg.:
version: '2'
services:
graphicnodered:
image: nodered/node-red:rpi
build: .
ports:
- 1880:1880
- 9099:9099
if you don't want to swich into the folder all the time you have to run it like
docker run -it -p 1880:1880 -p 9099:9099 --name mynodered -v /home/$USER/.node-red:/data nodered/node-red:1.0.6-12-minimal-arm64v8
Uninstalling golang-docker-credential-helpers resolved this issue for me.