Skip to content

Commit

Permalink
follow best practices maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Dec 8, 2024
1 parent a978dda commit a565b88
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 74 deletions.
6 changes: 2 additions & 4 deletions packages/service-integration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ LABEL maintainer=pcrespov
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -54,8 +53,7 @@ ENV PATH="${VIRTUAL_ENV}/bin:$PATH"

FROM base AS build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
3 changes: 1 addition & 2 deletions requirements/tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ FROM python:${PYTHON_VERSION}-slim-bookworm AS base

ENV VIRTUAL_ENV=/home/scu/.venv

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update \
&& apt-get -y install --no-install-recommends\
Expand Down
6 changes: 2 additions & 4 deletions services/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ LABEL maintainer=GitHK
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -71,8 +70,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/api-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ LABEL maintainer=pcrespov
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -67,8 +66,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/autoscaling/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ ENV DOCKER_APT_VERSION="5:26.1.4-1~debian.12~bookworm"
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -87,8 +86,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/catalog/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ LABEL maintainer=pcrespov
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -68,8 +67,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/clusters-keeper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ ENV DOCKER_APT_VERSION="5:26.1.4-1~debian.12~bookworm"
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -87,8 +86,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/dask-sidecar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ LABEL maintainer=sanderegg
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -78,8 +77,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/datcore-adapter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ LABEL maintainer=sanderegg
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -68,8 +67,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/director-v2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ LABEL maintainer=pcrespov
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -68,8 +67,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/director/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ LABEL maintainer=sanderegg
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -68,8 +67,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/dynamic-scheduler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ LABEL maintainer=pcrespov
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -67,8 +66,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
3 changes: 1 addition & 2 deletions services/dynamic-sidecar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/efs-guardian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ ENV DOCKER_APT_VERSION="5:26.1.4-1~debian.12~bookworm"
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -105,8 +104,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/invitations/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ LABEL maintainer=pcrespov
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -67,8 +66,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
3 changes: 1 addition & 2 deletions services/migration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
# --------------------------------------------
FROM base AS build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/payments/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ LABEL maintainer=pcrespov
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -67,8 +66,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/resource-usage-tracker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ LABEL maintainer=sanderegg
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -68,8 +67,7 @@ FROM base AS build

ENV SC_BUILD_TARGET=build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/storage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ LABEL maintainer=mguidon
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -75,8 +74,7 @@ FROM base AS build

ENV SC_BUILD_TARGET build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
6 changes: 2 additions & 4 deletions services/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ LABEL maintainer=pcrespov
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -78,8 +77,7 @@ FROM base AS build

ENV SC_BUILD_TARGET build

RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down

0 comments on commit a565b88

Please sign in to comment.