Unverified Commit d8c18758 authored by Jam Balaya's avatar Jam Balaya Committed by GitHub

chore: add `syntax` parser directive to Dockerfile (#72380)

## What?
Add [`syntax`](https://docs.docker.com/reference/dockerfile/#syntax)
parser directive to the first line of the
[Dockerfile](https://docs.docker.com/reference/dockerfile/).

## Why?
To declare the Dockerfile syntax version to use for the build.
If unspecified, [BuildKit](https://docs.docker.com/build/buildkit/) uses
a bundled version of the Dockerfile frontend.

## How?
Append `# syntax=docker.io/docker/dockerfile:1` to the top of the
[Dockerfile](https://docs.docker.com/reference/dockerfile/).
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 3b5b5a25
# syntax=docker.io/docker/dockerfile:1
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=20-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
......
# syntax=docker.io/docker/dockerfile:1
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=20-bullseye
FROM node:${VARIANT}
......
# syntax=docker.io/docker/dockerfile:1
FROM ubuntu:22.04
LABEL com.github.actions.name="Next.js PR Stats"
......
# syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine
WORKDIR /app
......
# syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine
WORKDIR /app
......
# syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine AS base
# Step 1. Rebuild the source code only when needed
......
# syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine AS base
# 1. Install dependencies only when needed
......
# syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine AS base
# 1. Install dependencies only when needed
......
# syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine AS base
# 1. Install dependencies only when needed
......
# syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine AS base
# Install dependencies only when needed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment