Skip to content

Commit 0e0ad82

Browse files
fix: address access issues in the ARM64 image build pipeline (#1201)
2 parents ff6e83b + ae5cce9 commit 0e0ad82

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/build-publish-mcr.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ jobs:
120120
# install it manually here.
121121
run:
122122
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
123-
- name: 'Set up build essential meta package'
123+
- name: 'Set up build dependencies'
124124
# Note (chenyu1): the self-hosted 1ES ARM64 pool, for some reason, does not have the common build
125-
# tools (e.g., make) installed by default; install the build-essential meta package to set them up.
125+
# tools (e.g., make) installed by default; install them manually.
126126
run: |
127127
sudo apt-get update
128-
sudo apt-get install -y build-essential
128+
sudo apt-get install -y build-essential acl
129129
- name: 'Set up Docker'
130130
# Note (chenyu1): the self-hosted 1ES ARM64 pool, for some reason, does not have Docker installed by default,
131131
# and cannot have Docker installed via the docker/setup-docker-action Github Action, hence the manual setup
@@ -142,8 +142,18 @@ jobs:
142142
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
143143
sudo apt-get update
144144
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
145+
- name: 'Enable Docker access'
146+
# Note (chenyu1): there are situations where the newgrp command will not take effect; set access
147+
# to the docker daemon directly just in case.
148+
run: |
149+
sudo groupadd docker || true
150+
echo "Adding $USER to the docker group"
151+
sudo usermod -aG docker $USER
152+
newgrp docker
153+
sudo setfacl --modify user:$USER:rw /var/run/docker.sock
145154
- name: 'Login the ACR'
146-
# Note (chenyu1): must login with root privileges to have Docker access.
155+
# Note (chenyu1): must not use root privileges; the system seems to have some trouble
156+
# retrieving credentials when sudo is used.
147157
run: |
148158
sudo az login --identity
149159
sudo az acr login -n ${{ secrets.AZURE_REGISTRY }}
@@ -184,4 +194,4 @@ jobs:
184194
env:
185195
CRD_INSTALLER_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.release_tag }}-arm64
186196
REGISTRY: ${{ secrets.AZURE_REGISTRY }}/${{ env.REGISTRY_REPO}}
187-
TARGET_ARCH: arm64
197+
TARGET_ARCH: arm64

0 commit comments

Comments
 (0)