Skip to content

Commit

Permalink
[Build]: fix ENABLE_DOCKER_BASE_PULL not working issue in armhf/arm64 (
Browse files Browse the repository at this point in the history
…#10330)

Why I did it
Fix ENABLE_DOCKER_BASE_PULL not working issue in armhf/arm64
For build in native armhf/arm64, the expected container registry repo name is sonic-slave-<stretch|buster|bullseye>

How I did it
Publish the slave image to sonic-slave-<stretch|buster|bullseye>.
  • Loading branch information
xumia authored Mar 30, 2022
1 parent 1ddcfd0 commit ced22db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .azure-pipelines/docker-sonic-slave-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pr:
- sonic-slave-stretch
- sonic-slave-buster
- sonic-slave-bullseye
- .azure-pipelines

parameters:
- name: 'dists'
Expand Down
1 change: 1 addition & 0 deletions .azure-pipelines/docker-sonic-slave-armhf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pr:
- sonic-slave-stretch
- sonic-slave-buster
- sonic-slave-bullseye
- .azure-pipelines

parameters:
- name: 'dists'
Expand Down
15 changes: 15 additions & 0 deletions .azure-pipelines/docker-sonic-slave-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ jobs:
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE_UPLOAD:latest
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE_UPLOAD:$SLAVE_BASE_TAG
if [ "$SLAVE_BASE_IMAGE_UPLOAD" != "$SLAVE_DIR" ]; then
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_DIR:latest-${{ parameters.arch }}
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_DIR:$SLAVE_BASE_TAG
fi
set +x
echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_IMAGE]$SLAVE_BASE_IMAGE_UPLOAD"
echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_TAG]$SLAVE_BASE_TAG"
Expand All @@ -89,6 +93,7 @@ jobs:
displayName: Build sonic-slave-${{ parameters.dist }}-${{ parameters.arch }}
- task: Docker@2
condition: ne(variables['Build.Reason'], 'PullRequest')
displayName: Upload image
inputs:
containerRegistry: ${{ parameters.registry_conn }}
Expand All @@ -97,3 +102,13 @@ jobs:
tags: |
$(VARIABLE_SLAVE_BASE_TAG)
latest
- ${{ if ne(parameters.arch, 'amd64') }}:
- task: Docker@2
condition: ne(variables['Build.Reason'], 'PullRequest')
displayName: Upload image ${{ parameters.dist }}
inputs:
containerRegistry: ${{ parameters.registry_conn }}
repository: "sonic-slave-${{ parameters.dist }}"
command: push
tags: |
$(VARIABLE_SLAVE_BASE_TAG)
1 change: 1 addition & 0 deletions .azure-pipelines/docker-sonic-slave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pr:
- sonic-slave-buster
- sonic-slave-bullseye
- src/sonic-build-hooks
- .azure-pipelines

parameters:
- name: 'arches'
Expand Down

0 comments on commit ced22db

Please sign in to comment.