Skip to content

Commit ceea7c4

Browse files
updated jdk17 dind and tf deploy docker images
1 parent 24fe275 commit ceea7c4

File tree

7 files changed

+205
-16
lines changed

7 files changed

+205
-16
lines changed

.github/workflows/build-publish-jdk11-tf-depoy-image.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ jobs:
4040
- name: Get software versions
4141
run: bash get_software_versions.sh
4242

43-
- name: print env vars
44-
run: |
45-
echo ${{ env.TF_VERSION }}
46-
echo ${{ env.AZ_CLI_VERSION }}
47-
4843
- name: Build and docker image with latest tag
4944
uses: docker/build-push-action@v5
5045
with:
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: build-publish-jdk17-dind-image
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '30 11 17 * *' # morning 110:30 am on 17th of every month
6+
7+
run-name: build-publish-jdk17-dind-image
8+
jobs:
9+
build-publish-jdk17-dind-image:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
21+
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Build and docker image with tag
29+
uses: docker/build-push-action@v6
30+
with:
31+
file: jdk-17/dind/Dockerfile
32+
load: true
33+
push: false
34+
tags: |
35+
${{ secrets.DOCKERHUB_USERNAME }}/jenkins-slave-dind-jdk17-image:latest
36+
37+
- name: List files
38+
run: ls -la
39+
40+
- name: Get software versions
41+
run: bash get_software_versions.sh
42+
43+
- name: Build and docker image with latest tag
44+
uses: docker/build-push-action@v6
45+
with:
46+
file: jdk-17/dind/Dockerfile
47+
push: true
48+
platforms: linux/amd64,linux/arm64
49+
tags: |
50+
${{ secrets.DOCKERHUB_USERNAME }}/jenkins-slave-dind-jdk17-image:latest
51+
52+
- name: Build and docker image with tag
53+
uses: docker/build-push-action@v6
54+
with:
55+
file: jdk-11/dind/Dockerfile
56+
push: true
57+
platforms: linux/amd64,linux/arm64
58+
tags: |
59+
${{ secrets.DOCKERHUB_USERNAME }}/jenkins-slave-dind-jdk17-image:docker_${{ env.DOCKER_VERSION }}_az_${{ env.AZ_CLI_VERSION }}
60+
61+
- name: set up docker and scan docker image for vulnerabilities
62+
uses: docker-practice/actions-setup-docker@master
63+
- run: |
64+
set -x
65+
docker version
66+
docker run -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image ${{ secrets.DOCKERHUB_USERNAME }}/jenkins-slave-dind-jdk11-image:latest
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: build-publish-jdk17-tf-deploy-image
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 12 17 * *' # morning 12:00 pm on 17th of every month
6+
7+
run-name: build-publish-jdk17-tf-deploy-image
8+
jobs:
9+
build-publish-jdk17-tf-deploy-image:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
21+
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Build and docker image with tag
29+
uses: docker/build-push-action@v5
30+
with:
31+
file: jdk-17/tf-deploy/Dockerfile
32+
load: true
33+
push: false
34+
tags: |
35+
${{ secrets.DOCKERHUB_USERNAME }}/jenkins-slave-tf-deploy-jdk17-image:latest
36+
37+
- name: List files
38+
run: ls -la
39+
40+
- name: Get software versions
41+
run: bash get_software_versions.sh
42+
43+
- name: Build and docker image with latest tag
44+
uses: docker/build-push-action@v5
45+
with:
46+
file: jdk-17/tf-deploy/Dockerfile
47+
push: true
48+
platforms: linux/amd64,linux/arm64
49+
tags: |
50+
${{ secrets.DOCKERHUB_USERNAME }}/jenkins-slave-tf-deploy-jdk17-image:latest
51+
52+
- name: Build wand docker image with tag
53+
uses: docker/build-push-action@v6
54+
with:
55+
file: jdk-11/tf-deploy/Dockerfile
56+
push: true
57+
platforms: linux/amd64,linux/arm64
58+
tags: |
59+
${{ secrets.DOCKERHUB_USERNAME }}/jenkins-slave-tf-deploy-jdk17-image:tf_${{ env.TERRAFORM_VERSION }}_az_${{ env.AZ_CLI_VERSION }}
60+
61+
- name: set up docker and scan docker image for vulnerabilities
62+
uses: docker-practice/actions-setup-docker@master
63+
- run: |
64+
set -x
65+
docker version
66+
docker run -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image ${{ secrets.DOCKERHUB_USERNAME }}/jenkins-slave-tf-deploy-jdk11-image:latest

jdk-11/dind/Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ RUN apt-get update && \
3434
docker-buildx-plugin \
3535
docker-compose
3636

37-
# Get Docker version
38-
RUN docker --version >> docker-version.txt
39-
4037
# Install Azure CLI latest available version
4138
RUN mkdir -p /etc/apt/keyrings && \
4239
curl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null && \
@@ -46,6 +43,3 @@ RUN mkdir -p /etc/apt/keyrings && \
4643
tee /etc/apt/sources.list.d/azure-cli.list > /dev/null && \
4744
apt-get update && \
4845
apt-get install -y -qq azure-cli
49-
50-
# Get Azure CLI version
51-
RUN az --version >> az-version.txt

jdk-11/tf-deploy/Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ RUN wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/shar
1515
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list && \
1616
apt-get update -y && apt-get install terraform -y && terraform --version
1717

18-
# Get terraform version
19-
RUN terraform --version >> terraform-version.txt
20-
2118
# install azure cli latest avaialble version - https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt
2219
RUN apt-get update -y && \
2320
mkdir -p /etc/apt/keyrings && \
@@ -28,5 +25,3 @@ RUN apt-get update -y && \
2825
apt-get update && \
2926
apt-get install azure-cli -y
3027

31-
# Get Azure cli version
32-
RUN az --version >> az-version.txt

jdk-17/dind/Dockerfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Using jenkins/inbound-agent:latest-jdk17 as base image
2+
FROM jenkins/inbound-agent:latest-jdk17
3+
4+
# Add label
5+
LABEL authors="githubofkrishnadhas"
6+
7+
# Root user
8+
USER root
9+
10+
# Install Docker & basic packages
11+
RUN apt-get update && \
12+
apt-get install -y -qq \
13+
ca-certificates \
14+
curl \
15+
wget \
16+
zip \
17+
apt-transport-https \
18+
lsb-release \
19+
gnupg \
20+
git \
21+
software-properties-common && \
22+
mkdir -p /etc/apt/keyrings && \
23+
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && \
24+
chmod a+r /etc/apt/keyrings/docker.asc && \
25+
echo \
26+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
27+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
28+
tee /etc/apt/sources.list.d/docker.list > /dev/null && \
29+
apt-get update && \
30+
apt-get install -y -qq \
31+
docker-ce \
32+
docker-ce-cli \
33+
containerd.io \
34+
docker-buildx-plugin \
35+
docker-compose
36+
37+
# Install Azure CLI latest available version
38+
RUN mkdir -p /etc/apt/keyrings && \
39+
curl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null && \
40+
chmod go+r /etc/apt/keyrings/microsoft.gpg && \
41+
AZ_DIST=$(lsb_release -cs) && \
42+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ $AZ_DIST main" | \
43+
tee /etc/apt/sources.list.d/azure-cli.list > /dev/null && \
44+
apt-get update && \
45+
apt-get install -y -qq azure-cli
46+

jdk-17/tf-deploy/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Jenkins inbound agent as base image
2+
FROM jenkins/inbound-agent:latest-jdk17
3+
4+
# Root user for installations
5+
USER root
6+
7+
# update and upgrade system packages
8+
RUN apt-get update -y && apt-get upgrade -y
9+
10+
# install basic packages
11+
RUN apt-get install -y git openssh-server ca-certificates curl apt-transport-https lsb-release gnupg wget software-properties-common
12+
13+
# Install terraform - https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli
14+
RUN wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && \
15+
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list && \
16+
apt-get update -y && apt-get install terraform -y && terraform --version
17+
18+
19+
# install azure cli latest avaialble version - https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt
20+
RUN apt-get update -y && \
21+
mkdir -p /etc/apt/keyrings && \
22+
curl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null && \
23+
chmod go+r /etc/apt/keyrings/microsoft.gpg && \
24+
AZ_DIST=$(lsb_release -cs) && \
25+
echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ $AZ_DIST main" | tee /etc/apt/sources.list.d/azure-cli.list && \
26+
apt-get update && \
27+
apt-get install azure-cli -y

0 commit comments

Comments
 (0)