Skip to content

Commit

Permalink
Bump Docker images to latest Python 3x (#108)
Browse files Browse the repository at this point in the history
* bump(docker): Use latest python:3 image as base reference

* make(docker): Implement basic dockerignore to reduce image footprint
  • Loading branch information
titom73 authored Dec 13, 2024
1 parent fe4bc4f commit f741255
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Ignore everything
*

# Allow files and directories
!/eos_downloader/
!/pyproject.toml
!/LICENSE

# Ignore unnecessary files inside allowed directories
# This should go after the allowed directories
**/*~
**/*.log
**/.DS_Store
**/Thumbs.db
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VER=3.10
ARG PYTHON_VER=3

FROM python:${PYTHON_VER}-slim

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.docker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VER=3.10
ARG PYTHON_VER=3

FROM python:${PYTHON_VER}-slim

Expand Down
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
CURRENT_DIR = $(shell pwd)

DOCKER_NAME ?= titom73/eos-downloader
DOCKER_NAME ?= ghcr.io/titom73/eos-downloader
DOCKER_TAG ?= dev
DOCKER_FILE ?= Dockerfile
PYTHON_VER ?= 3.9
PYTHON_VER ?= 3

.PHONY: build
build:
.PHONY: help
help: ## Display help message
@grep -E '^[0-9a-zA-Z_-]+\.*[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: base
base: ## Build a base image
docker build -t $(DOCKER_NAME):$(DOCKER_TAG) --build-arg DOCKER_VERSION=$(DOCKER_VERSION) -f $(DOCKER_FILE) .

.PHONY: dnd
dnd: ## Build a docker in docker image
docker build -t $(DOCKER_NAME):dnd-$(DOCKER_TAG) --build-arg DOCKER_VERSION=$(DOCKER_VERSION) -f Dockerfile.docker .

.PHONY: build
build: base dnd ## Build all dockers images (base and dnd)

.PHONY: push
push: ## Push the docker image to the registry
docker push $(DOCKER_NAME):$(DOCKER_TAG)

0 comments on commit f741255

Please sign in to comment.