yolov5_ros2
package is based on yolov5_ros2
config
stores the yolov5
model and camera info. After building yolov5_ros2
, copy config
to install/yolov5_ros2/share/yolov5_ros2/config
docker build -f ros2_yolov5.dockerfile -t yolov5_ros2:galactic-k3s .
Add mirrors
to /etc/rancher/k3s/registries.yaml
(If not exist then create the file)
mirrors:
192.168.193.113:5000:
endpoint:
- "http://192.168.193.113:5000"
Restart
sudo systemctl restart k3s #master
sudo systemctl restart k3s-agent #agent
- modify
/etc/docker/daemon.json
Add following content todaemon.json
{
"insecure-registries": ["ip_address:5000"]
}
- restart docker
systemctl daemon-reload && systemctl restart docker
May need to add registry-mirrors
to daemon.json
as well
{
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
],
"insecure-registries": ["ip_address:5000"]
}
- pull and run registry on the server
docker pull registry:latest
docker run -d -p 5000:5000 --restart=always --name registry registry
- modify
/etc/docker/daemon.json
Add following content todaemon.json
{
"insecure-registries": ["ip_address:5000"]
}
- restart docker
systemctl daemon-reload && systemctl restart docker
- pull the image of
docker-registry-ui
docker pull joxit/docker-registry-ui:1.5-static
- deploy UI
docker run -p 8280:80 --name registry-ui \
-e REGISTRY_URL="http://ip_address:5000" \
-e DELETE_IMAGES="true" \
-e REGISTRY_TITLE="TIERS registry" \
-d joxit/docker-registry-ui:1.5-static
# docker run -p 8280:80 --name registry-ui -e REGISTRY_URL="http://ip_address:5000" -e DELETE_IMAGES="true" -e REGISTRY_TITLE="TIERS registry"
- pull image or build image with dockerfile
- tag the image to registry
# docker tag IMAGE:TAG REGISTRY_HOST:REGISTRY_PORT/REPOSITORY:TAG
docker tag hello-world:latest ip_address:5000/hello-world:latest
- push the image to registry
docker push ip_address:5000/hello-world:latest
- check images
curl ip_address:5000/v2/_catalog
# {"repositories":["hello-world"]}
- pull images from registry
docker pull ip_address:5000/hello-world:latest