Skip to content

Commit

Permalink
Merge branch 'docker:main' into sssc-docker-concepts
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenhoff007 authored Oct 17, 2024
2 parents 5bd5f41 + 1c61f93 commit 03588b3
Show file tree
Hide file tree
Showing 47 changed files with 1,870 additions and 82 deletions.
1 change: 1 addition & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ area/engine:
- changed-files:
- any-glob-to-any-file:
- content/manuals/engine/**
- content/reference/api/engine/**

area/install:
- changed-files:
Expand Down
45 changes: 15 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,27 @@ ARG ALPINE_VERSION=3.20
ARG GO_VERSION=1.23
# HTMLTEST_VERSION sets the wjdp/htmltest version for HTML testing
ARG HTMLTEST_VERSION=0.17.0
# HUGO_VERSION sets the version of Hugo to build the site with
ARG HUGO_VERSION=0.136.0

# base is the base stage with build dependencies
FROM golang:${GO_VERSION}-alpine AS base
WORKDIR /src
RUN apk --update add nodejs npm git gcompat

# node installs Node.js dependencies
FROM base AS node
COPY package*.json .
ENV NODE_ENV=production
RUN npm install

# hugo downloads and extracts the Hugo binary
FROM base AS hugo
ARG HUGO_VERSION=0.134.3
ARG TARGETARCH
WORKDIR /tmp/hugo
RUN wget -O "hugo.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz"
RUN tar -xf "hugo.tar.gz" hugo

# build-base is the base stage for building the site
FROM base AS build-base
COPY --from=hugo /tmp/hugo/hugo /bin/hugo
COPY --from=node /src/node_modules /src/node_modules
# build-base is the base stage used for building the site
FROM ghcr.io/gohugoio/hugo:v${HUGO_VERSION} AS build-base
USER root
ENV NODE_ENV="production"
RUN --mount=source=package.json,target=package.json \
--mount=source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci
COPY . .

# dev is for local development with Docker Compose
FROM build-base AS dev

# build creates production builds with Hugo
FROM build-base AS build
# HUGO_ENV sets the hugo.Environment (production, development, preview)
ARG HUGO_ENV
ARG HUGO_ENV="development"
# DOCS_URL sets the base URL for the site
ARG DOCS_URL
RUN hugo --gc --minify -d /out -e $HUGO_ENV -b $DOCS_URL
ARG DOCS_URL="https://docs.docker.com"
RUN --mount=type=cache,target=/cache \
hugo --gc --minify -d /out -e $HUGO_ENV -b $DOCS_URL

# lint lints markdown files
FROM davidanson/markdownlint-cli2:v0.14.0 AS lint
Expand Down Expand Up @@ -122,7 +107,7 @@ fi
EOT

# pagefind installs the Pagefind runtime
FROM base AS pagefind
FROM node:alpine${ALPINE_VERSION} AS pagefind
ARG PAGEFIND_VERSION=1.1.1
COPY --from=build /out ./public
RUN --mount=type=bind,src=pagefind.yml,target=pagefind.yml \
Expand Down
14 changes: 13 additions & 1 deletion _vale/config/vocabularies/Docker/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ Grafana
Gravatar
HTTP
HyperKit
IAM
IPs?
IPv[46]
IPvlan
Intel
Intune
Jamf
JFrog
JetBrains
Kerberos
Kitematic
Kubernetes
LTS
Expand All @@ -80,16 +84,20 @@ Logstash
MAC
Mac
Mail(chimp|gun)
MDM
Microsoft
MySQL
NAT
Netplan
Nginx
NTLM
Nuxeo
OAT
OAuth
OCI
OTel
Okta
PAT
Postgres
PowerShell
Python
Expand Down Expand Up @@ -138,8 +146,10 @@ Zsh
[Ff]iletypes?
[GgCc]oroutine
[Hh]ostname
[Ii]nfosec
[Ll]oopback
[Mm]oby
[Oo]nboarding
[Pp]aravirtualization
[Pp]roxying
[Rr]eal-time
Expand All @@ -149,10 +159,12 @@ Zsh
[Ss]warm
[Tt]oolchains?
[Vv]irtualize
[Vv]irtiofs
[Ww]alkthrough
cgroup
config
containerd
deprovisioning
deserialization
deserialize
displayName
Expand Down Expand Up @@ -187,4 +199,4 @@ ufw
umask
ungated
vSphere
virtiofs
vpnkit
13 changes: 13 additions & 0 deletions archetypes/guides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: '{{ replace .File.ContentBaseName `-` ` ` | humanize }}'
# linkTitle: A shorter, alternative title
description: # Meta description for SEO.
summary: | # A summary of what's in this guide
In this guide, ...
languages: [] # Programming languages used
products: [] # Docker products involved
levels: [] # Experience level(s) of the intended audience (beginner|intermediate|advanced)
subjects: [] # What's it about?
params:
# time: 10 minutes
---
Binary file added assets/images/guides/bake.webp
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
server:
build:
context: .
target: dev
target: build-base
ports:
- "1313:1313"
entrypoint: ["hugo", "server", "--bind", "0.0.0.0"]
Expand All @@ -11,5 +11,3 @@ services:
- action: sync
path: .
target: /src
ignore:
- node_modules/
Loading

0 comments on commit 03588b3

Please sign in to comment.