Skip to content

Commit 284c50e

Browse files
committed
ci(actions-runner-images): refactor directory structure and add tools-ubuntu image
- Refactored the directory structure for ubuntu base image. - Renamed `src/images/ubuntu/base` to `src/images/.base-ubuntu`. - Moved Dockerfile and build-base.ps1 from `src/images/ubuntu/base` to `src/images/.base-ubuntu`. - Updated context path in build-and-push - ubuntu job from `./src/images/ubuntu/default` to `./src/images/ubuntu`. - Added a new job, build-and-push - tools-ubuntu, which builds and pushes a new docker image named tools-ubuntu. - This new docker image is based on github-actions-runner:ubuntu-base. - It includes scripts for installing azcopy and azure-cli.
1 parent 862624b commit 284c50e

File tree

7 files changed

+49
-2
lines changed

7 files changed

+49
-2
lines changed

.github/workflows/actions-runner-images.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ jobs:
4444
- name: build - ubuntu - base
4545
shell: pwsh
4646
run: ./build-base.ps1
47-
working-directory: ./src/images/ubuntu/base
47+
working-directory: ./src/images/.base-ubuntu
4848

4949

5050
- name: build-and-push - ubuntu
5151
uses: docker/build-push-action@v3
5252
with:
53-
context: ./src/images/ubuntu/default
53+
context: ./src/images/ubuntu
5454
platforms: |
5555
linux/amd64
5656
tags: |
@@ -62,3 +62,19 @@ jobs:
6262
org.opencontainers.image.licenses=MIT
6363
6464
65+
- name: build-and-push - tools-ubuntu
66+
uses: docker/build-push-action@v3
67+
with:
68+
context: ./src/images/tools-ubuntu
69+
platforms: |
70+
linux/amd64
71+
tags: |
72+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:tools
73+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:tools-latest
74+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:tools-ubuntu
75+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:tools-ubuntu-latest
76+
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
77+
labels: |
78+
org.opencontainers.image.licenses=MIT
79+
80+
File renamed without changes.
File renamed without changes.

src/images/tools-ubuntu/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM github-actions-runner:ubuntu-base
2+
3+
4+
WORKDIR /install
5+
6+
COPY /scripts /scripts
7+
8+
RUN for script in /scripts/install*.sh; do \
9+
echo "Running $script"; \
10+
bash -e $script || { echo "Script $script failed" >&2; exit 1; }; \
11+
done && \
12+
rm -rf /scripts
13+
14+
15+
RUN rm -rf /scripts
16+
17+
USER runner
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
wget -O azcopy.tar.gz https://aka.ms/downloadazcopy-v10-linux
4+
tar zxvf azcopy.tar.gz --strip-components=1 -C /usr/local/bin
5+
ln -sf /usr/local/bin/azcopy /usr/local/bin/azcopy10
6+
7+
azcopy10 --version
8+
azcopy --version
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
curl -fsSL https://aka.ms/InstallAzureCLIDeb | bash
4+
5+
rm -f /etc/apt/sources.list.d/azure-cli.list
6+
rm -f /etc/apt/sources.list.d/azure-cli.list.save
File renamed without changes.

0 commit comments

Comments
 (0)