Compare commits

...

12 Commits

Author SHA1 Message Date
unkinben 93c0e3af35 Merge pull request 'feat: enable multirelease' (#6) from neoloc/multirelease into master
Deploy / build (push) Successful in 1m59s
Reviewed-on: https://git.query.consul/unkin/docker-almalinux-jupyterinstance/pulls/6
2024-12-20 20:42:33 +11:00
unkinben ac7bafa7b3 feat: enable multirelease
Build / build (pull_request) Successful in 2m8s
- manage almalinux 8 and 9 deployments
2024-12-20 20:39:03 +11:00
unkinben ebd96a4324 Merge pull request 'feat: use runnerdnd image' (#5) from neoloc/runnerdnd into master
Deploy / build (push) Successful in 3m29s
Reviewed-on: https://git.query.consul/unkin/docker-almalinux-jupyterinstance/pulls/5
2024-12-01 13:19:55 +11:00
unkinben 7fe43de00c feat: use runnerdnd image
Build / build (pull_request) Successful in 4s
- remove environment steps as they are now in the runnerdnd image
2024-12-01 13:18:27 +11:00
unkinben 6fe441a9c9 Merge pull request 'feat: add common required modules to the jupyter instance' (#4) from neoloc/python_modules into master
Deploy / build (push) Successful in 3m50s
Reviewed-on: https://git.query.consul/unkin/docker-almalinux-jupyterinstance/pulls/4
2024-11-16 19:55:19 +11:00
unkinben df744c031b feat: add common required modules to the jupyter instance
Build / build (pull_request) Successful in 1m10s
- numpy, pandas, matplotlib, pyarrow, pyyaml
2024-11-16 19:52:38 +11:00
unkinben 6bff1ed83f Merge pull request 'feat: makefile advancements' (#3) from neoloc/add_work_dir into master
Deploy / build (push) Successful in 46s
Reviewed-on: https://git.query.consul/unkin/docker-almalinux-jupyterinstance/pulls/3
2024-11-16 19:11:40 +11:00
unkinben 0f2d2b49ca feat: makefile advancements
Build / build (pull_request) Successful in 44s
- add test target
- update clean target
2024-11-16 19:09:23 +11:00
unkinben e075640c0c Merge pull request 'feat: add work directory to container' (#2) from neoloc/add_work_dir into master
Deploy / build (push) Successful in 51s
Reviewed-on: https://git.query.consul/unkin/docker-almalinux-jupyterinstance/pulls/2
2024-11-16 19:06:19 +11:00
unkinben adc01e2707 feat: add work directory to container
Build / build (pull_request) Successful in 2m17s
2024-11-16 19:03:14 +11:00
unkinben 7386f2f9d9 Merge pull request 'feat: first commit of jupyterinstnace' (#1) from neoloc/firstimage into master
Deploy / build (push) Successful in 1m9s
Reviewed-on: https://git.query.consul/unkin/docker-almalinux-jupyterinstance/pulls/1
2024-11-10 20:19:41 +11:00
unkinben e02d3a0c6d feat: first commit of jupyterinstnace
Build / build (pull_request) Successful in 1m41s
- builds container with python3.12 and minimal required pip packages
2024-11-10 12:39:55 +11:00
7 changed files with 130 additions and 62 deletions
+1 -8
View File
@@ -7,17 +7,10 @@ jobs:
build: build:
runs-on: almalinux-8 runs-on: almalinux-8
container: container:
image: git.query.consul/unkin/almalinux8:latest image: git.query.consul/unkin/almalinux8-runnerdnd:latest
options: --privileged options: --privileged
steps: steps:
- name: Set up environment
run: |
dnf install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf module enable -y nodejs:20
dnf install -y docker-ce-cli make bash git nodejs
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
+1 -8
View File
@@ -9,17 +9,10 @@ jobs:
build: build:
runs-on: almalinux-8 runs-on: almalinux-8
container: container:
image: git.query.consul/unkin/almalinux8:latest image: git.query.consul/unkin/almalinux8-runnerdnd:latest
options: --privileged options: --privileged
steps: steps:
- name: Set up environment
run: |
dnf install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf module enable -y nodejs:20
dnf install -y docker-ce-cli make bash git nodejs
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
-18
View File
@@ -1,18 +0,0 @@
# Start with the AlmaLinux 8.10 base image
FROM git.query.consul/unkin/almalinux8:latest
# Clean and update the repository cache
RUN dnf clean all && \
dnf makecache
# Install nodejs:20 for actions
RUN dnf module enable -y nodejs:20 && \
dnf install -y nodejs
# Install packages
RUN dnf groupinstall -y 'Development Tools' && \
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget
# Cleanup
RUN dnf clean all && \
rm -rf /var/cache/dnf
+35 -21
View File
@@ -1,34 +1,48 @@
# Get the current Git commit hash # Variables
GIT_COMMIT := $(shell git rev-parse --short HEAD) GIT_COMMIT := $(shell git rev-parse --short HEAD)
# Get the current date in YYYYMMDD format
DATE_TAG := $(shell date +%Y%m%d) DATE_TAG := $(shell date +%Y%m%d)
# Set the Docker image name and repository information
IMAGE_NAME := almalinux8-template
REGISTRY := git.query.consul REGISTRY := git.query.consul
OWNER := unkin OWNER := unkin
# Build the Docker image (without tags) # List of releases (directories under ./release)
build: RELEASES := $(shell find release -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
docker build --network=host -t $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) .
# Tag the Docker image with the Git commit hash, the date, and 'latest' # Build all releases
tag: build: $(addprefix build-,$(RELEASES))
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(GIT_COMMIT)
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(DATE_TAG)
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):latest
# Push the Docker image to a repository with all tags # Tag all releases
push: tag tag: $(addprefix tag-,$(RELEASES))
echo "template repo, not pushing"
#docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(GIT_COMMIT)
#docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(DATE_TAG)
#docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):latest
# Clean up dangling Docker images # Push all releases
push: $(addprefix push-,$(RELEASES))
# Clean dangling images
clean: clean:
docker image prune -f docker image prune -f
# List all available releases
list:
@echo "Available releases:"
@echo $(RELEASES) | tr ' ' '\n'
# Build a specific release
build-%:
$(info Building almalinux$*-jupyterinstance Docker image)
docker build --network=host -t $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance -f release/$*/Dockerfile release/$*
# Tag a specific release
tag-%:
$(info Tagging almalinux$*-jupyterinstance Docker image)
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:$(GIT_COMMIT)
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:$(DATE_TAG)
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:latest
# Push a specific release
push-%: tag-%
$(info Pushing almalinux$*-jupyterinstance Docker image)
docker push $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:$(GIT_COMMIT)
docker push $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:$(DATE_TAG)
docker push $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:latest
# Default target # Default target
default: build default: build
+7 -7
View File
@@ -1,4 +1,4 @@
# Docker Image Build: Almalinux Template # Docker Image Build: Almalinux Jupyterinstance
This project provides a reproducible Docker image build process for `almalinux:8.10`, with custom YUM repository configurations and package installations. The build is automated using a `Makefile` and managed via CI tasks to ensure consistent and reliable Docker image builds. This project provides a reproducible Docker image build process for `almalinux:8.10`, with custom YUM repository configurations and package installations. The build is automated using a `Makefile` and managed via CI tasks to ensure consistent and reliable Docker image builds.
@@ -16,7 +16,7 @@ To build the Docker image without tags:
make build make build
``` ```
This will use the `docker build` command with `--network=host` to build the image with the name `git.query.consul/unkin/almalinux8-template`. This will use the `docker build` command with `--network=host` to build the image with the name `git.query.consul/unkin/almalinux8-jupyterinstance.
### Tag the Docker Image ### Tag the Docker Image
@@ -27,9 +27,9 @@ make tag
``` ```
This will add three tags to the image: This will add three tags to the image:
- `git.query.consul/unkin/almalinux8-template:<GIT_COMMIT>` - `git.query.consul/unkin/almalinux8-jupyterinstance:<GIT_COMMIT>`
- `git.query.consul/unkin/almalinux8-template:<DATE_TAG>` - `git.query.consul/unkin/almalinux8-jupyterinstance:<DATE_TAG>`
- `git.query.consul/unkin/almalinux8-template:latest` - `git.query.consul/unkin/almalinux8-jupyterinstance:latest`
### Push the Docker Image ### Push the Docker Image
@@ -67,8 +67,8 @@ To test or develop with this `Makefile`, follow these steps:
1. **Clone the repository** and navigate to the project directory: 1. **Clone the repository** and navigate to the project directory:
```bash ```bash
git clone https://git.query.consul/unkin/docker-template.git git clone https://git.query.consul/unkin/docker-almalinux-jupyterinstance.git
cd docker-template cd docker-almalinux-jupyterinstance
``` ```
2. **Build the Docker image** using the `build` target: 2. **Build the Docker image** using the `build` target:
+43
View File
@@ -0,0 +1,43 @@
# Start with the AlmaLinux 8.10 base image
FROM git.query.consul/unkin/almalinux8:latest
# Clean and update the repository cache
RUN dnf clean all && \
dnf makecache
# Install packages
RUN dnf install -y python3.12 python3.12-pip
# Cleanup
RUN dnf clean all && \
rm -rf /var/cache/dnf
# create venv for jupyter
RUN python3.12 -m venv /opt/jupyter
# upgrade pip
RUN /opt/jupyter/bin/python -m pip install --upgrade pip
# install requirements for jupyterhub-singleinstance
RUN /opt/jupyter/bin/pip install \
'jupyterhub==5.2.1' \
'notebook==7.2.2'
# install additional python modules
RUN /opt/jupyter/bin/pip install \
numpy \
pandas \
matplotlib \
pyarrow \
pyyaml
# create a user, since we don't want to run as root
RUN useradd -m jupyter
ENV HOME=/home/jupyter
RUN mkdir $HOME/work
RUN chown jupyter:jupyter $HOME/work
WORKDIR $HOME/work
USER jupyter
# set the default command
CMD ["/opt/jupyter/bin/jupyterhub-singleuser"]
+43
View File
@@ -0,0 +1,43 @@
# Start with the AlmaLinux 8.10 base image
FROM git.query.consul/unkin/almalinux9:latest
# Clean and update the repository cache
RUN dnf clean all && \
dnf makecache
# Install packages
RUN dnf install -y python3.12 python3.12-pip
# Cleanup
RUN dnf clean all && \
rm -rf /var/cache/dnf
# create venv for jupyter
RUN python3.12 -m venv /opt/jupyter
# upgrade pip
RUN /opt/jupyter/bin/python -m pip install --upgrade pip
# install requirements for jupyterhub-singleinstance
RUN /opt/jupyter/bin/pip install \
'jupyterhub==5.2.1' \
'notebook==7.2.2'
# install additional python modules
RUN /opt/jupyter/bin/pip install \
numpy \
pandas \
matplotlib \
pyarrow \
pyyaml
# create a user, since we don't want to run as root
RUN useradd -m jupyter
ENV HOME=/home/jupyter
RUN mkdir $HOME/work
RUN chown jupyter:jupyter $HOME/work
WORKDIR $HOME/work
USER jupyter
# set the default command
CMD ["/opt/jupyter/bin/jupyterhub-singleuser"]