docker image improvs
This commit is contained in:
parent
01db97924e
commit
3500383e7d
3 changed files with 9 additions and 13 deletions
|
|
@ -2,9 +2,10 @@
|
||||||
FROM python:3.11.7-slim-bullseye
|
FROM python:3.11.7-slim-bullseye
|
||||||
|
|
||||||
# Install system dependencies required for building certain Python packages
|
# 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 \
|
gcc \
|
||||||
curl wget libmagic-dev ffmpeg \
|
libmagic-dev \
|
||||||
|
ffmpeg \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Set the working directory in the container to /app
|
# Set the working directory in the container to /app
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
FROM python:3.11.7-slim-bullseye
|
FROM python:3.11.7-slim-bullseye
|
||||||
|
|
||||||
# Install system dependencies required for building certain Python packages
|
# 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 \
|
gcc \
|
||||||
curl wget libmagic-dev ffmpeg supervisor \
|
curl wget libmagic-dev ffmpeg supervisor \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
|
||||||
15
Makefile
15
Makefile
|
|
@ -5,7 +5,6 @@ VERSION := $(shell grep -m1 version pyproject.toml | cut -d'"' -f2)
|
||||||
IMAGE_NAME := lfnovo/open_notebook
|
IMAGE_NAME := lfnovo/open_notebook
|
||||||
|
|
||||||
PLATFORMS=linux/amd64,linux/arm64
|
PLATFORMS=linux/amd64,linux/arm64
|
||||||
#,linux/arm/v7,linux/386
|
|
||||||
|
|
||||||
database:
|
database:
|
||||||
docker compose --profile db_only up
|
docker compose --profile db_only up
|
||||||
|
|
@ -19,26 +18,22 @@ lint:
|
||||||
ruff:
|
ruff:
|
||||||
ruff check . --fix
|
ruff check . --fix
|
||||||
|
|
||||||
# Configuração do buildx para multi-plataforma
|
# buildx config for multi-plataform
|
||||||
docker-buildx-prepare:
|
docker-buildx-prepare:
|
||||||
docker buildx create --use --name multi-platform-builder || true
|
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-build: docker-buildx-prepare
|
||||||
docker buildx build \
|
docker buildx build --pull \
|
||||||
--platform $(PLATFORMS) \
|
--platform $(PLATFORMS) \
|
||||||
-t $(IMAGE_NAME):$(VERSION) \
|
-t $(IMAGE_NAME):$(VERSION) \
|
||||||
--push \
|
--push \
|
||||||
.
|
.
|
||||||
|
|
||||||
# O push já é feito durante o build com buildx
|
# Build and push combined
|
||||||
docker-push:
|
|
||||||
@echo "Push já foi realizado durante o build com buildx"
|
|
||||||
|
|
||||||
# Build e push combinados
|
|
||||||
docker-release: docker-build
|
docker-release: docker-build
|
||||||
|
|
||||||
# Comando útil para verificar as plataformas suportadas após o build
|
# Check supported platforms
|
||||||
docker-check-platforms:
|
docker-check-platforms:
|
||||||
docker manifest inspect $(IMAGE_NAME):$(VERSION)
|
docker manifest inspect $(IMAGE_NAME):$(VERSION)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue