Skip to content

Commit

Permalink
test github action
Browse files Browse the repository at this point in the history
Signed-off-by: Daisuke Sato <daisukes@cmu.edu>
  • Loading branch information
daisukes committed Jun 10, 2024
1 parent 2e9a2f6 commit 95870ce
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test Building Docker Image and Workspace

on:
push:
branches: [ daisukes/docker-buildx-bake-test ]

jobs:
test_build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3

- name: Install vcs
run: pip3 install vcstool

- name: Prepare thirdparty repos
run: ./setup-dependency.sh

- name: Prepare local docker registry
run: docker compose up -d

- name: Buildx bake
run: ./build-docker.sh -P cabot-navigation
7 changes: 6 additions & 1 deletion build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ fi

export ROS_DISTRO=humble
export UBUNTU_DISTRO=jammy
export REGISTRY=registry:5000

# setup local docker registry for multiplatform support
docker compose up -d

# setup multiplatform builder
docker buildx rm mybuilder
docker buildx create --use --name mybuilder --driver docker-container \
--driver-opt network=host # option to make the builder access to the registry on the localhost
--config buildkitd.toml \
--driver-opt network=registry-network # option to make the builder access to the registry on the localhost

# replace ros Dockerfile FROM instruction to replace base image
while read -r line; do
Expand All @@ -58,6 +61,8 @@ else
docker buildx bake
fi



docker pull localhost:5000/cabot-base-humble-desktop-custom-mesa
docker image tag localhost:5000/cabot-base-humble-desktop-custom-mesa ${prefix}__jammy-humble-custom-mesa
docker pull localhost:5000/cabot-base-humble-base-custom
Expand Down
3 changes: 3 additions & 0 deletions buildkitd.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[registry."registry:5000"]
http = true
insecure = true
2 changes: 1 addition & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ variable "BASE_IMAGE" {
}

variable "REGISTRY" {
default = "localhost:5000"
default = "registry"
}

group "default" {
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ services:
image: registry:2.7
ports:
- 127.0.0.1:5000:5000
networks:
- registry-network


networks:
registry-network:
name: registry-network

0 comments on commit 95870ce

Please sign in to comment.