fujitatomoya / ros_k8s

Kuberenetes / ROS&ROS2 Cluster Samples
Creative Commons Attribution 4.0 International
192 stars 29 forks source link

ROS noetic / rolling multi-arch container image support #5

Closed fujitatomoya closed 1 year ago

fujitatomoya commented 1 year ago

Currently container images need to be built on each architecture before application container deployment by kubernetes cluster. This needs to be addressed for multi-architecture using https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/, probably docker buildx.

fujitatomoya commented 1 year ago

Tried to use docker buildx under experimental, it did not work out for arm64 on my local environment. I think that i am going to just use manifest file to support multi-arch images.

tomoyafujita@~/DVT/github.com/fujitatomoya/ros_k8s/docker >docker buildx build --rm --push --platform linux/amd64,linux/arm64 -f Dockerfile.noetic --tag $DOCKERHUB_USERNAME/ros-noetic .
[+] Building 0.0s (0/0)                                                                                                 
ERROR: multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use")
tomoyafujita@~/DVT/github.com/fujitatomoya/ros_k8s/docker >docker buildx create --use
quirky_kowalevski
tomoyafujita@~/DVT/github.com/fujitatomoya/ros_k8s/docker >docker buildx ls
NAME/NODE            DRIVER/ENDPOINT             STATUS   BUILDKIT PLATFORMS
quirky_kowalevski *  docker-container                              
  quirky_kowalevski0 unix:///var/run/docker.sock inactive          
default              docker                                        
  default            default                     running  20.10.12 linux/amd64, linux/386
tomoyafujita@~/DVT/github.com/fujitatomoya/ros_k8s/docker >docker buildx inspect --bootstrap
[+] Building 13.3s (1/1) FINISHED                                                                                       
 => [internal] booting buildkit                                                                                   13.2s
 => => pulling image moby/buildkit:buildx-stable-1                                                                 4.6s
 => => creating container buildx_buildkit_quirky_kowalevski0                                                       8.7s
Name:          quirky_kowalevski
Driver:        docker-container
Last Activity: 2023-01-27 07:10:45 +0000 UTC

Nodes:
Name:      quirky_kowalevski0
Endpoint:  unix:///var/run/docker.sock
Status:    running
Buildkit:  v0.11.2
Platforms: linux/amd64, linux/amd64/v2, linux/386
tomoyafujita@~/DVT/github.com/fujitatomoya/ros_k8s/docker >docker buildx ls
NAME/NODE            DRIVER/ENDPOINT             STATUS  BUILDKIT PLATFORMS
quirky_kowalevski *  docker-container                             
  quirky_kowalevski0 unix:///var/run/docker.sock running v0.11.2  linux/amd64, linux/amd64/v2, linux/386
default              docker                                       
  default            default                     running 20.10.12 linux/amd64, linux/386
tomoyafujita@~/DVT/github.com/fujitatomoya/ros_k8s/docker >docker buildx use default
tomoyafujita@~/DVT/github.com/fujitatomoya/ros_k8s/docker >docker buildx ls
NAME/NODE            DRIVER/ENDPOINT             STATUS  BUILDKIT PLATFORMS
quirky_kowalevski    docker-container                             
  quirky_kowalevski0 unix:///var/run/docker.sock running v0.11.2  linux/amd64, linux/amd64/v2, linux/386
default *            docker                                       
  default            default                     running 20.10.12 linux/amd64, linux/386
tomoyafujita@~/DVT/github.com/fujitatomoya/ros_k8s/docker >docker buildx rm quirky_kowalevski
^[[Aquirky_kowalevski removed
tomoyafujita@~/DVT/github.com/fujitatomoya/ros_k8s/docker >docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS  BUILDKIT PLATFORMS
default * docker                           
  default default         running 20.10.12 linux/amd64, linux/386
fujitatomoya commented 1 year ago

addressed by https://github.com/fujitatomoya/ros_k8s/commit/3939c8c62801f7ff443c282c1ddd6bd44321fdf9