Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use upper-case for "as" in FROM ... AS instruction #110

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/generators/templates/Dockerfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ ARG RUBY_VERSION=<%= RUBY_VERSION %>

<% end -%>
<% if options.fullstaq -%>
FROM <%= platform %>quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-<%= options.jemalloc ? 'jemalloc-' : 'malloctrim-' %><%= variant %><% unless options.precompile == "defer" %> as base<% end %>
FROM <%= platform %>quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-<%= options.jemalloc ? 'jemalloc-' : 'malloctrim-' %><%= variant %><% unless options.precompile == "defer" %> AS base<% end %>
<% else -%>
FROM <%= platform %><%= options.registry %>ruby:$RUBY_VERSION-<%= variant %><% unless options.precompile == "defer" %> as base<% end %>
FROM <%= platform %><%= options.registry %>ruby:$RUBY_VERSION-<%= variant %><% unless options.precompile == "defer" %> AS base<% end %>
<% end -%>

<% unless options.label.empty? -%>
Expand Down Expand Up @@ -50,15 +50,15 @@ RUN gem update --system <% if RUBY_VERSION.start_with? '2' %>3.4.22 <% end %>--n
<% unless options.precompile == "defer" -%>

# Throw-away build stage<%= parallel? ? 's' : '' %> to reduce size of final image
FROM base as <%= parallel? ? 'pre' : '' %>build
FROM base AS <%= parallel? ? 'pre' : '' %>build

<% end -%>
# Install packages needed to build gems<%= using_node? ? " and node modules" : "" %>
<%= render partial: 'apt_install', locals: {packages: build_packages, clean: false, repos: ''} %>

<% if parallel? -%>

FROM prebuild as <% if using_bun? %>bun<% else %>node<% end %>
FROM prebuild AS <% if using_bun? %>bun<% else %>node<% end %>

<% end -%>
<% if using_bun? and (!using_execjs? || File.exist?('bun.lockb')) -%>
Expand All @@ -72,7 +72,7 @@ FROM prebuild as <% if using_bun? %>bun<% else %>node<% end %>
<%= render partial: 'npm_install', locals: {sources: Dir[*%w(package.json yarn.lock bun.lockb)]} %>


FROM prebuild as build
FROM prebuild AS build

<% end -%>
<% unless build_args.empty? -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/templates/_node_client.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG NODE_VERSION=<%= node_version %>

FROM <%= platform %>node:$NODE_VERSION-slim as client
FROM <%= platform %>node:$NODE_VERSION-slim AS client

WORKDIR /rails/<%= api_client_dir %>

Expand Down
4 changes: 2 additions & 2 deletions test/results/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-alpine as base
FROM ruby:$RUBY_VERSION-alpine AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -24,7 +24,7 @@ RUN apk update && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems and node modules
RUN apk update && \
Expand Down
6 changes: 3 additions & 3 deletions test/results/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ARG RUBY_VERSION=xxx
ARG NODE_VERSION=xxx

FROM node:$NODE_VERSION-slim as client
FROM node:$NODE_VERSION-slim AS client

WORKDIR /rails/my-app

Expand All @@ -19,7 +19,7 @@ COPY --link my-app .
RUN npm run build


FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -36,7 +36,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/bin_cd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/bun/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/cache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems and node modules
RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
Expand Down
4 changes: 2 additions & 2 deletions test/results/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/config/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-malloctrim-slim as base
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-malloctrim-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/esbuild/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems and node modules
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/execjs_importmap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand Down Expand Up @@ -31,7 +31,7 @@ RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/execjs_node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand Down Expand Up @@ -31,7 +31,7 @@ RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems and node modules
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/fullstaq/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-malloctrim-slim as base
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-malloctrim-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/grover/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand Down Expand Up @@ -31,7 +31,7 @@ RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems and node modules
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/idle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -29,7 +29,7 @@ RUN apt-get update -qq && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/jemalloc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM --platform=linux/amd64 ruby:$RUBY_VERSION-slim as base
FROM --platform=linux/amd64 ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/label/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

LABEL runtime="rails"

Expand All @@ -21,7 +21,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/litefs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/litestack/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -20,7 +20,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
4 changes: 2 additions & 2 deletions test/results/minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=xxx
FROM ruby:$RUBY_VERSION-slim as base
FROM ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
WORKDIR /rails
Expand All @@ -19,7 +19,7 @@ RUN gem update --system --no-document && \


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build gems
RUN apt-get update -qq && \
Expand Down
Loading
Loading