Skip to content

Commit 1020d8f

Browse files
authoredJun 27, 2024··
Add git to base images and automate DockerHub push (#247)
* Add github action workflow to push images to docker hub. * Add git to all base images. * Update changelog and bump version. * Update github action. * Remove test links. * Fix publish workflow. * Fix changelog.
1 parent 098ab40 commit 1020d8f

File tree

7 files changed

+97
-4
lines changed

7 files changed

+97
-4
lines changed
 
+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Publish Skelebot base Docker images
2+
3+
# Run when base-images folder is modified and also allow manual run
4+
on:
5+
push:
6+
branches:
7+
- master
8+
paths:
9+
- 'base-images/**'
10+
workflow_dispatch:
11+
12+
jobs:
13+
publish_py:
14+
name: Publish pure Python base image
15+
strategy:
16+
matrix:
17+
version: ['3.9', '3.10', '3.11']
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Login to Docker Hub
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
- name: Publish image
33+
uses: docker/build-push-action@v6
34+
with:
35+
context: base-images/python-base/${{ matrix.version }}/
36+
tags: skelebot/python-base:${{ matrix.version }}
37+
outputs: |
38+
type=registry
39+
type=docker,dest=/tmp/skelebot_base_${{ matrix.version }}.tar
40+
41+
# Save 3.9 base image locally to use as base for Kerberos image
42+
- name: Cache Python 3.9 base image
43+
if: ${{ matrix.version == '3.9' }}
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: skelebot_base_3.9
47+
path: /tmp/skelebot_base_3.9.tar
48+
49+
50+
publish_py_krb:
51+
name: Publish Python Kerberos base image
52+
runs-on: ubuntu-latest
53+
needs: publish_py
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
58+
- name: Set up Docker Buildx
59+
uses: docker/setup-buildx-action@v3
60+
61+
- name: Download Python 3.9 base image from cache
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: skelebot_base_3.9
65+
path: /tmp
66+
67+
- name: Load cached Python 3.9 base image into context
68+
run: docker load --input /tmp/skelebot_base_3.9.tar
69+
70+
- name: Login to Docker Hub
71+
uses: docker/login-action@v3
72+
with:
73+
username: ${{ secrets.DOCKERHUB_USERNAME }}
74+
password: ${{ secrets.DOCKERHUB_TOKEN }}
75+
76+
- name: Publish Python Kerberos image
77+
uses: docker/build-push-action@v6
78+
with:
79+
context: base-images/python-krb/
80+
tags: skelebot/python-krb
81+
push: true

‎CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ Documenting All Changes to the Skelebot Project
33

44
---
55

6+
## v2.0.1
7+
#### Changed
8+
- **Base Images** | Added `git` to all the base images.
9+
- **CI/CD** | Upload base images to Docker Hub via GitHub Action whenever there's an update.
10+
11+
---
12+
613
## v2.0.0
14+
#### Merged: 2024-06-06
15+
#### Released: 2024-06-06
716
#### Changed
817
- **Dependencies** | All project dependencies, regardless of source (individual packages, local or remote files, requirements files, pyproject scripts) are now installed together in a single `pip install ...` command.
918
- **Build system** | Refactored build system to use a single `pyproject.toml` script. Switched build backend from `setuptools` to `hatchling`.

‎VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
2.0.1

‎base-images/python-base/3.10/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MAINTAINER Sean Shookman <sshookman@cars.com>
44
# Install basic compilers and libraries commonly needed for downstream packages
55
RUN apt-get update && \
66
DEBIAN_FRONTEND=noninteractive \
7-
apt-get install -y -q build-essential libgomp1 && \
7+
apt-get install -y -q git build-essential libgomp1 && \
88
apt-get clean && \
99
rm -rf /var/lib/apt/lists/*
1010

‎base-images/python-base/3.11/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MAINTAINER Sean Shookman <sshookman@cars.com>
44
# Install basic compilers and libraries commonly needed for downstream packages
55
RUN apt-get update && \
66
DEBIAN_FRONTEND=noninteractive \
7-
apt-get install -y -q build-essential libgomp1 && \
7+
apt-get install -y -q git build-essential libgomp1 && \
88
apt-get clean && \
99
rm -rf /var/lib/apt/lists/*
1010

‎base-images/python-base/3.9/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MAINTAINER Sean Shookman <sshookman@cars.com>
44
# Install basic compilers and libraries commonly needed for downstream packages
55
RUN apt-get update && \
66
DEBIAN_FRONTEND=noninteractive \
7-
apt-get install -y -q build-essential libgomp1 && \
7+
apt-get install -y -q git build-essential libgomp1 && \
88
apt-get clean && \
99
rm -rf /var/lib/apt/lists/*
1010

‎jobs/publish.sh

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The preferred way to publish to Docker Hub is now via .github/workflows/publish-base-images.yaml
2+
# We keep this script in case there is a need for a manual push
3+
14
# Login to Docker Hub with Skelebot user
25
docker login -u skelebot
36

0 commit comments

Comments
 (0)
Please sign in to comment.