Skip to content

Commit 0de0585

Browse files
authored
Merge pull request #148 from Madhan-SWE/pr_build_action_v2
Github action added for building the centos base image for ibm-powervs-block-csi-driver
2 parents e7db166 + 83c6fae commit 0de0585

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This is a GitHub workflow defining a set of jobs with a set of steps.
2+
# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
3+
#
4+
# This test is meant to verify that our Dockerfile can build successfully when
5+
# changed on the CPU architectures we have made it support being built on.
6+
#
7+
name: Build ibm-powervs-block-csi-driver-centos-base
8+
9+
on:
10+
push:
11+
paths:
12+
- "build/base/Dockerfile"
13+
- ".github/workflows/docker-build.yml"
14+
15+
jobs:
16+
docker:
17+
name: Build ibm-powervs-block-csi-driver-centos-base
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
steps:
23+
- name: Checkout sources
24+
uses: actions/checkout@v2
25+
26+
# Action reference: https://github.com/docker/setup-qemu-action
27+
- name: Set up QEMU (for docker buildx)
28+
uses: docker/setup-qemu-action@v1
29+
30+
# Action reference: https://github.com/docker/setup-buildx-action
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v1
33+
34+
# Action reference: https://github.com/docker/login-action
35+
- name: Login to GitHub Container Registry
36+
uses: docker/login-action@v1
37+
with:
38+
registry: ghcr.io
39+
username: ${{ github.repository_owner }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
41+
42+
# Convert repository owner name into lowercase letters
43+
# Action reference: https://github.com/ASzc/change-string-case-action
44+
- id: repository_owner
45+
name: lower case repository owner name
46+
uses: ASzc/change-string-case-action@v1
47+
with:
48+
string: ${{ github.repository_owner }}
49+
50+
# Action reference: https://github.com/docker/build-push-action
51+
- name: Build container
52+
uses: docker/build-push-action@v2
53+
with:
54+
context: ./build/base
55+
platforms: linux/amd64,linux/ppc64le
56+
target: centos-base
57+
push: true
58+
tags: ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/ibm-powervs-block-csi-driver-centos-base:v8.0.0

build/base/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2022 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# centos base image
16+
FROM quay.io/centos/centos:stream8 AS centos-base
17+
RUN yum install -y util-linux nfs-utils e2fsprogs xfsprogs ca-certificates && yum clean all && rm -rf /var/cache/yum

0 commit comments

Comments
 (0)