Skip to content

Commit 5e07f9d

Browse files
authored
fix: update release github workflow (#365)
* fix permissions in out directory * use a local registry to communicate containers from build to github actions
1 parent f13c89a commit 5e07f9d

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

.github/workflows/build-and-release.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,32 @@ jobs:
101101
- name: Fetch build environment
102102
run: |
103103
docker pull $BENV_IMAGE
104-
- name: Build artifacts
104+
- name: Create and fix permissions for output directory
105105
run: |
106106
mkdir -p $GITHUB_WORKSPACE/out
107+
sudo chown -R 1000:1000 $GITHUB_WORKSPACE/out
108+
- name: Build artifacts
109+
run: |
110+
# Start local registry for the build process
111+
docker run -d -p 5000:5000 --name registry docker.io/library/registry:2
112+
113+
# Build all containers and push to local registry
107114
docker run -t --rm \
108115
--mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \
109116
--mount "type=bind,source=$GITHUB_WORKSPACE/src,destination=/home/user/src,readonly" \
110117
--mount "type=bind,source=$GITHUB_WORKSPACE/out,destination=/home/user/out" \
111118
--env EBPF_NET_SRC_ROOT=/home/user/src \
119+
--network host \
120+
--privileged \
112121
$BENV_IMAGE \
113-
./build.sh pipeline-docker
122+
./build.sh pipeline-docker-registry
123+
124+
# Pull images from local registry to make them available for docker tag/push
125+
docker pull localhost:5000/reducer
126+
docker pull localhost:5000/kernel-collector
127+
docker pull localhost:5000/cloud-collector
128+
docker pull localhost:5000/k8s-watcher
129+
docker pull localhost:5000/k8s-relay
114130
- name: Build packages
115131
run: |
116132
docker run -t --rm \
@@ -173,11 +189,15 @@ jobs:
173189
image_path="${docker_registry}/${DOCKER_NAMESPACE}/${image_name}"
174190
175191
for tag in ${tags[@]}; do
176-
docker tag $image ${image_path}:${tag}
192+
docker tag localhost:5000/$image ${image_path}:${tag}
177193
if [[ "${{ inputs.dry_run }}" == "false" ]]; then
178194
docker push ${image_path}:${tag}
179195
fi
180196
done
181197
done
182198
199+
# Clean up local registry
200+
docker stop registry || true
201+
docker rm registry || true
202+
183203
docker images --no-trunc

0 commit comments

Comments
 (0)