Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Fix Docker build warnings (#4573)

Dhruv Bhanushali998414708cfa
diff --git a/api/Dockerfile b/api/Dockerfile
index cbe67a826..b4e03c145 100644
--- a/api/Dockerfile
+++ b/api/Dockerfile
@@ -145,9 +145,9 @@ CMD ["python", "run.py"]
# NGINX #
#########
-FROM docker.io/nginx:1.26.0-alpine as nginx
+FROM docker.io/nginx:1.26.0-alpine AS nginx
-LABEL org.opencontainers.image.source = "https://github.com/WordPress/openverse"
+LABEL org.opencontainers.image.source="https://github.com/WordPress/openverse"
WORKDIR /app
diff --git a/catalog/Dockerfile b/catalog/Dockerfile
index b29aa207c..51effb1b1 100644
--- a/catalog/Dockerfile
+++ b/catalog/Dockerfile
@@ -5,9 +5,9 @@
ARG CATALOG_PY_VERSION
ARG CATALOG_AIRFLOW_VERSION
-FROM apache/airflow:slim-${CATALOG_AIRFLOW_VERSION}-python${CATALOG_PY_VERSION} as cat
+FROM apache/airflow:slim-${CATALOG_AIRFLOW_VERSION}-python${CATALOG_PY_VERSION} AS cat
-LABEL org.opencontainers.image.source = "https://github.com/WordPress/openverse"
+LABEL org.opencontainers.image.source="https://github.com/WordPress/openverse"
# Build-time arguments, with sensible defaults
ARG REQUIREMENTS_FILE=requirements-prod.txt
diff --git a/docker/upstream_db/Dockerfile b/docker/upstream_db/Dockerfile
index 85e0d6033..c00c7c2bc 100644
--- a/docker/upstream_db/Dockerfile
+++ b/docker/upstream_db/Dockerfile
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
-FROM postgres:13.10 as db
+FROM postgres:13.10 AS db
ARG PGCLI_VERSION
diff --git a/frontend/Dockerfile b/frontend/Dockerfile
index 8863b45a6..5516ff018 100644
--- a/frontend/Dockerfile
+++ b/frontend/Dockerfile
@@ -7,7 +7,7 @@ ARG FRONTEND_NODE_VERSION
# Node.js builder #
###################
-FROM docker.io/node:${FRONTEND_NODE_VERSION}-alpine as builder
+FROM docker.io/node:${FRONTEND_NODE_VERSION}-alpine AS builder
# Automatically use the right version of pnpm.
ARG FRONTEND_PNPM_VERSION
@@ -53,7 +53,7 @@ RUN pnpm build:only
# Nuxt app #
############
-FROM docker.io/node:${FRONTEND_NODE_VERSION}-alpine as app
+FROM docker.io/node:${FRONTEND_NODE_VERSION}-alpine AS app
LABEL org.opencontainers.image.source="https://github.com/WordPress/openverse"
diff --git a/frontend/Dockerfile.nginx b/frontend/Dockerfile.nginx
index 80b107d23..f4d36e0ea 100644
--- a/frontend/Dockerfile.nginx
+++ b/frontend/Dockerfile.nginx
@@ -13,9 +13,9 @@
# NGINX #
#########
-FROM docker.io/nginx:1.26.0-alpine as nginx
+FROM docker.io/nginx:1.26.0-alpine AS nginx
-LABEL org.opencontainers.image.source = "https://github.com/WordPress/openverse"
+LABEL org.opencontainers.image.source="https://github.com/WordPress/openverse"
WORKDIR /app
diff --git a/indexer_worker/Dockerfile b/indexer_worker/Dockerfile
index e2c7465a6..e1337468e 100644
--- a/indexer_worker/Dockerfile
+++ b/indexer_worker/Dockerfile
@@ -7,7 +7,7 @@ ARG INDEXER_WORKER_PY_VERSION
# Python builder #
##################
-FROM docker.io/python:${INDEXER_WORKER_PY_VERSION} as builder
+FROM docker.io/python:${INDEXER_WORKER_PY_VERSION} AS builder
# Container optimizations
ENV PYTHONUNBUFFERED=1
@@ -36,7 +36,7 @@ RUN pdm install --check --frozen-lockfile $PDM_INSTALL_ARGS
# Indexer worker #
####################
-FROM docker.io/python:${INDEXER_WORKER_PY_VERSION}-slim as indexer_worker
+FROM docker.io/python:${INDEXER_WORKER_PY_VERSION}-slim AS indexer_worker
LABEL org.opencontainers.image.source="https://github.com/WordPress/openverse"
@@ -48,7 +48,7 @@ ENV PIP_NO_COLOR=1
# Activate the virtualenv
ENV PATH="/.venv/bin:$PATH"
-ENV PYTHONPATH="$PYTHONPATH:/indexer_worker/"
+ENV PYTHONPATH="/indexer_worker/"
# TLDEXTRACT fails to cache in /home/supervisord, set its cache to /tmp instead
ENV TLDEXTRACT_CACHE="/tmp/python-tldextract"
diff --git a/ingestion_server/Dockerfile b/ingestion_server/Dockerfile
index 9d390a0e8..b1a0405dc 100644
--- a/ingestion_server/Dockerfile
+++ b/ingestion_server/Dockerfile
@@ -7,7 +7,7 @@ ARG INGESTION_PY_VERSION
# Python builder #
##################
-FROM docker.io/python:${INGESTION_PY_VERSION} as builder
+FROM docker.io/python:${INGESTION_PY_VERSION} AS builder
# Container optimizations
ENV PYTHONUNBUFFERED=1
@@ -38,7 +38,7 @@ RUN pipenv install --system --deploy --dev
# Ingestion server #
####################
-FROM docker.io/python:${INGESTION_PY_VERSION}-slim as ing
+FROM docker.io/python:${INGESTION_PY_VERSION}-slim AS ing
LABEL org.opencontainers.image.source="https://github.com/WordPress/openverse"
@@ -50,7 +50,7 @@ ENV PIP_NO_COLOR=1
# Activate the virtualenv
ENV PATH="/venv/bin:$PATH"
-ENV PYTHONPATH="$PYTHONPATH:/ingestion_server/"
+ENV PYTHONPATH="/ingestion_server/"
# TLDEXTRACT fails to cache in /home/supervisord, set its cache to /tmp instead
ENV TLDEXTRACT_CACHE="/tmp/python-tldextract"
diff --git a/utilities/load_testing/Dockerfile b/utilities/load_testing/Dockerfile
index ab1605b83..c959e56d0 100644
--- a/utilities/load_testing/Dockerfile
+++ b/utilities/load_testing/Dockerfile
@@ -4,7 +4,7 @@
# K6 #
######
-FROM docker.io/grafana/k6:v0.51.0 as k6
+FROM docker.io/grafana/k6:v0.51.0 AS k6
###############
# Observation #