From 3500383e7df204eeafe2d9f17f35f4c82a58ebb6 Mon Sep 17 00:00:00 2001 From: LUIS NOVO Date: Thu, 14 Nov 2024 15:22:18 -0300 Subject: [PATCH] docker image improvs --- Dockerfile | 5 +++-- Dockerfile.single | 2 +- Makefile | 15 +++++---------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index f3b9e00..be29a73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,10 @@ FROM python:3.11.7-slim-bullseye # Install system dependencies required for building certain Python packages -RUN apt-get update && apt-get install -y \ +RUN apt-get update && apt-get upgrade -y && apt-get install -y \ gcc \ - curl wget libmagic-dev ffmpeg \ + libmagic-dev \ + ffmpeg \ && rm -rf /var/lib/apt/lists/* # Set the working directory in the container to /app diff --git a/Dockerfile.single b/Dockerfile.single index 769a973..1e09853 100644 --- a/Dockerfile.single +++ b/Dockerfile.single @@ -2,7 +2,7 @@ FROM python:3.11.7-slim-bullseye # Install system dependencies required for building certain Python packages -RUN apt-get update && apt-get install -y \ +RUN apt-get update && apt-get upgrade -y && apt-get install -y \ gcc \ curl wget libmagic-dev ffmpeg supervisor \ && rm -rf /var/lib/apt/lists/* diff --git a/Makefile b/Makefile index e3cd985..c22fe3d 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,6 @@ VERSION := $(shell grep -m1 version pyproject.toml | cut -d'"' -f2) IMAGE_NAME := lfnovo/open_notebook PLATFORMS=linux/amd64,linux/arm64 -#,linux/arm/v7,linux/386 database: docker compose --profile db_only up @@ -19,26 +18,22 @@ lint: ruff: ruff check . --fix -# Configuração do buildx para multi-plataforma +# buildx config for multi-plataform docker-buildx-prepare: docker buildx create --use --name multi-platform-builder || true -# Build multi-plataforma com buildx +# multi-plataform build with buildx docker-build: docker-buildx-prepare - docker buildx build \ + docker buildx build --pull \ --platform $(PLATFORMS) \ -t $(IMAGE_NAME):$(VERSION) \ --push \ . -# O push já é feito durante o build com buildx -docker-push: - @echo "Push já foi realizado durante o build com buildx" - -# Build e push combinados +# Build and push combined docker-release: docker-build -# Comando útil para verificar as plataformas suportadas após o build +# Check supported platforms docker-check-platforms: docker manifest inspect $(IMAGE_NAME):$(VERSION)