Skip to content

Commit

Permalink
curl only needs to be installed once
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Jan 5, 2025
1 parent 4ba7040 commit cf77e59
Show file tree
Hide file tree
Showing 42 changed files with 19 additions and 161 deletions.
14 changes: 7 additions & 7 deletions lib/generators/dockerfile_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def alpinize(packages)
end

def base_packages
packages = %w(curl)
packages = %w(curl) # work with the default healthcheck strategy in Kamal
packages += @@packages["base"] if @@packages["base"]

packages << "libjemalloc2" if options.jemalloc? && !options.fullstaq?
Expand All @@ -703,7 +703,7 @@ def base_packages
end

if using_puppeteer?
packages += %w(curl gnupg)
packages += %w(gnupg)
end

# charlock_holmes. Placed here as the library itself is
Expand Down Expand Up @@ -762,7 +762,7 @@ def build_packages
packages += %w(node-gyp pkg-config)

unless using_execjs? || using_puppeteer?
packages << "curl"
# packages << "curl"
end

# module build process depends on Python, and debian changed
Expand All @@ -788,7 +788,7 @@ def build_packages
end

if using_bun?
packages += %w(curl unzip)
packages += %w(unzip)
end

if options.alpine?
Expand All @@ -799,7 +799,7 @@ def build_packages
end

def deploy_packages
packages = %w(curl) # work with the default healthcheck strategy in MRSK
packages = []
packages += @@packages["deploy"] if @@packages["deploy"]

# litefs
Expand Down Expand Up @@ -882,7 +882,7 @@ def base_repos
packages = []

if using_passenger?
packages += %w(gnupg curl)
packages += %w(curl gnupg)
repos += [
"curl https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt |",
" gpg --dearmor > /etc/apt/trusted.gpg.d/phusion.gpg &&",
Expand All @@ -908,7 +908,7 @@ def deploy_repos
packages = []

if using_puppeteer? && deploy_packages.include?("google-chrome-stable")
packages += %w(gnupg curl)
packages += %w(gnupg)
repos += [
"curl https://dl-ssl.google.com/linux/linux_signing_key.pub |",
" gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg &&",
Expand Down
4 changes: 2 additions & 2 deletions test/results/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FROM base AS build

# Install packages needed to build gems and node modules
RUN apk update && \
apk add build-base curl gyp libpq-dev pkgconfig python3 && \
apk add build-base gyp libpq-dev pkgconfig python3 && \
rm -rf /var/cache/apk/*

# Install JavaScript dependencies
Expand Down Expand Up @@ -73,7 +73,7 @@ FROM base

# Install packages needed for deployment
RUN apk update && \
apk add curl libpq && \
apk add libpq && \
rm -rf /var/cache/apk/*

# Copy built artifacts: gems, application
Expand Down
4 changes: 0 additions & 4 deletions test/results/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ RUN bundle exec bootsnap precompile app/ lib/
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/bin_cd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
6 changes: 1 addition & 5 deletions test/results/bun/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential curl pkg-config unzip && \
apt-get install --no-install-recommends -y build-essential pkg-config unzip && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Install Bun
Expand Down Expand Up @@ -67,10 +67,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
7 changes: 1 addition & 6 deletions test/results/cache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ FROM base AS build
RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
--mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt \
apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential curl node-gyp pkg-config python-is-python3
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3

# Install JavaScript dependencies
ARG NODE_VERSION=xxx
Expand Down Expand Up @@ -79,11 +79,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
--mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt \
apt-get update -qq && \
apt-get install --no-install-recommends -y curl

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/config/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
6 changes: 1 addition & 5 deletions test/results/esbuild/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FROM base AS build

# Install packages needed to build gems and node modules
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential curl node-gyp pkg-config python-is-python3 && \
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Install JavaScript dependencies
Expand Down Expand Up @@ -70,10 +70,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/execjs_importmap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/execjs_node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/fullstaq/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
2 changes: 1 addition & 1 deletion test/results/grover/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y chromium chromium-sandbox curl && \
apt-get install --no-install-recommends -y chromium chromium-sandbox && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
Expand Down
2 changes: 1 addition & 1 deletion test/results/idle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl libnginx-mod-http-passenger nginx && \
apt-get install --no-install-recommends -y libnginx-mod-http-passenger nginx && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# configure nginx and passenger
Expand Down
4 changes: 0 additions & 4 deletions test/results/jemalloc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/label/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
2 changes: 1 addition & 1 deletion test/results/litefs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ COPY config/litefs.yml /etc/litefs.yml

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y ca-certificates curl fuse3 sudo && \
apt-get install --no-install-recommends -y ca-certificates fuse3 sudo && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
Expand Down
4 changes: 0 additions & 4 deletions test/results/litestream/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
2 changes: 1 addition & 1 deletion test/results/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl nginx ruby-foreman && \
apt-get install --no-install-recommends -y nginx ruby-foreman && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# configure nginx
Expand Down
4 changes: 0 additions & 4 deletions test/results/no_precompiled_gems/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/no_prep/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
6 changes: 1 addition & 5 deletions test/results/parallel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FROM base AS prebuild

# Install packages needed to build gems and node modules
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential curl node-gyp pkg-config python-is-python3 && \
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives


Expand Down Expand Up @@ -81,10 +81,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/postgresql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
4 changes: 0 additions & 4 deletions test/results/precompile_defer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ COPY . .
# Precompile bootsnap code for faster boot times
RUN bundle exec bootsnap precompile app/ lib/

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Run and own only the runtime files as a non-root user for security
RUN groupadd --system --gid 1000 rails && \
Expand Down
4 changes: 0 additions & 4 deletions test/results/private_gemserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
Expand Down
Loading

0 comments on commit cf77e59

Please sign in to comment.