You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			32 lines
		
	
	
		
			784 B
		
	
	
	
		
			Docker
		
	
			
		
		
	
	
			32 lines
		
	
	
		
			784 B
		
	
	
	
		
			Docker
		
	
# syntax=docker/dockerfile:1.3
 | 
						|
 | 
						|
ARG GO_VERSION=1.17.0
 | 
						|
 | 
						|
FROM golang:${GO_VERSION}-alpine AS docsgen
 | 
						|
WORKDIR /src
 | 
						|
RUN --mount=target=. \
 | 
						|
  --mount=target=/root/.cache,type=cache \
 | 
						|
  go build -mod=vendor -o /out/docsgen ./docs/generate.go
 | 
						|
 | 
						|
FROM alpine AS gen
 | 
						|
RUN apk add --no-cache rsync git
 | 
						|
WORKDIR /src
 | 
						|
COPY --from=docsgen /out/docsgen /usr/bin
 | 
						|
RUN --mount=target=/context \
 | 
						|
  --mount=target=.,type=tmpfs,readwrite  \
 | 
						|
  rsync -a /context/. . && \
 | 
						|
  docsgen && \
 | 
						|
  mkdir /out && cp -r docs/reference /out
 | 
						|
 | 
						|
FROM scratch AS update
 | 
						|
COPY --from=gen /out /out
 | 
						|
 | 
						|
FROM gen AS validate
 | 
						|
RUN --mount=target=/context \
 | 
						|
  --mount=target=.,type=tmpfs,readwrite  \
 | 
						|
  rsync -a /context/. . && \
 | 
						|
  git add -A && \
 | 
						|
  rm -rf docs/reference/* && \
 | 
						|
  cp -rf /out/* ./docs/ && \
 | 
						|
  ./hack/validate-docs check
 |