Skip to content

Commit

Permalink
fix: dockerfile warnings (#10505)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcecagno authored Jul 12, 2024
1 parent df280a6 commit 4edde4d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions Dockerfile.django-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Dockerfile.nginx to use the caching mechanism of Docker.

# Ref: https://devguide.python.org/#branchstatus
FROM python:3.11.9-alpine3.20@sha256:df44c0c0761ddbd6388f4549cab42d24d64d257c2a960ad5b276bb7dab9639c7 as base
FROM base as build
FROM python:3.11.9-alpine3.20@sha256:df44c0c0761ddbd6388f4549cab42d24d64d257c2a960ad5b276bb7dab9639c7 AS base
FROM base AS build
WORKDIR /app
RUN \
apk update && \
Expand All @@ -33,12 +33,12 @@ COPY requirements.txt ./
# https://github.com/unbit/uwsgi/issues/1318#issuecomment-542238096
RUN CPUCOUNT=1 pip3 wheel --wheel-dir=/tmp/wheels -r ./requirements.txt

FROM base as django-alpine
FROM base AS django-alpine
WORKDIR /app
ARG uid=1001
ARG gid=1337
ARG appuser=defectdojo
ENV appuser ${appuser}
ENV appuser=${appuser}
RUN \
apk update && \
apk add --no-cache \
Expand Down Expand Up @@ -138,5 +138,5 @@ ENV \
DD_UWSGI_NUM_OF_THREADS="2"
ENTRYPOINT ["/entrypoint-uwsgi.sh"]

FROM django-alpine as django-unittests
COPY unittests/ ./unittests/
FROM django-alpine AS django-unittests
COPY unittests/ ./unittests/
10 changes: 5 additions & 5 deletions Dockerfile.django-debian
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Dockerfile.nginx to use the caching mechanism of Docker.

# Ref: https://devguide.python.org/#branchstatus
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e as base
FROM base as build
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e AS base
FROM base AS build
WORKDIR /app
RUN \
apt-get -y update && \
Expand All @@ -32,12 +32,12 @@ COPY requirements.txt ./
# https://github.com/unbit/uwsgi/issues/1318#issuecomment-542238096
RUN CPUCOUNT=1 pip3 wheel --wheel-dir=/tmp/wheels -r ./requirements.txt

FROM base as django
FROM base AS django
WORKDIR /app
ARG uid=1001
ARG gid=1337
ARG appuser=defectdojo
ENV appuser ${appuser}
ENV appuser=${appuser}
RUN \
apt-get -y update && \
# ugly fix to install postgresql-client without errors
Expand Down Expand Up @@ -141,5 +141,5 @@ ENV \
DD_UWSGI_NUM_OF_THREADS="2"
ENTRYPOINT ["/entrypoint-uwsgi.sh"]

FROM django as django-unittests
FROM django AS django-unittests
COPY unittests/ ./unittests/
6 changes: 3 additions & 3 deletions Dockerfile.integration-tests-debian
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

# code: language=Dockerfile

FROM openapitools/openapi-generator-cli:v7.7.0@sha256:99924315933d49e7b33a7d2074bb2b64fc8def8f74519939036e24eb48f00336 as openapitools
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e as build
FROM openapitools/openapi-generator-cli:v7.7.0@sha256:99924315933d49e7b33a7d2074bb2b64fc8def8f74519939036e24eb48f00336 AS openapitools
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e AS build
WORKDIR /app
RUN \
apt-get -y update && \
Expand Down Expand Up @@ -76,4 +76,4 @@ ENV \
DD_ADMIN_USER=admin \
DD_ADMIN_PASSWORD='' \
DD_BASE_URL="http://localhost:8080/"
CMD ["/entrypoint-integration-tests.sh"]
CMD ["/entrypoint-integration-tests.sh"]
8 changes: 4 additions & 4 deletions Dockerfile.nginx-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Dockerfile.django-alpine to use the caching mechanism of Docker.

# Ref: https://devguide.python.org/#branchstatus
FROM python:3.11.9-alpine3.20@sha256:df44c0c0761ddbd6388f4549cab42d24d64d257c2a960ad5b276bb7dab9639c7 as base
FROM base as build
FROM python:3.11.9-alpine3.20@sha256:df44c0c0761ddbd6388f4549cab42d24d64d257c2a960ad5b276bb7dab9639c7 AS base
FROM base AS build
WORKDIR /app
RUN \
apk update && \
Expand Down Expand Up @@ -36,7 +36,7 @@ RUN CPUCOUNT=1 pip3 wheel --wheel-dir=/tmp/wheels -r ./requirements.txt
FROM build AS collectstatic

# Node installation from https://github.com/nodejs/docker-node
ENV NODE_VERSION 20.11.0
ENV NODE_VERSION=20.11.0

RUN addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node \
Expand Down Expand Up @@ -105,7 +105,7 @@ RUN addgroup -g 1000 node \
&& node --version \
&& npm --version

ENV YARN_VERSION 1.22.19
ENV YARN_VERSION=1.22.19

RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar \
&& for key in \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.nginx-debian
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Dockerfile.django-debian to use the caching mechanism of Docker.

# Ref: https://devguide.python.org/#branchstatus
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e as base
FROM base as build
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e AS base
FROM base AS build
WORKDIR /app
RUN \
apt-get -y update && \
Expand Down

0 comments on commit 4edde4d

Please sign in to comment.