mirror docker/build-push-action@v4

This commit is contained in:
action-mirror
2026-09-13 22:53:13 +08:00
commit d0aeef06d8
76 changed files with 10624 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
# syntax=docker/dockerfile:1
FROM alpine
RUN echo "Hello world!"
+3
View File
@@ -0,0 +1,3 @@
# syntax=docker/dockerfile:1
FROM busybox
RUN cat /etc/hosts
+3
View File
@@ -0,0 +1,3 @@
# syntax=docker/dockerfile:1
FROM alpine
RUN cat /proc/self/cgroup
+19
View File
@@ -0,0 +1,19 @@
# syntax=docker/dockerfile:1
FROM golang:alpine AS base
ENV CGO_ENABLED=0
RUN apk add --no-cache file git
WORKDIR /src
FROM base AS build
RUN --mount=type=bind,target=/src \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags "-s -w" -o /usr/bin/app .
FROM scratch AS binary
COPY --from=build /usr/bin/app /bin/app
FROM alpine AS image
COPY --from=build /usr/bin/app /bin/app
EXPOSE 8080
ENTRYPOINT ["/bin/app"]
+3
View File
@@ -0,0 +1,3 @@
module github.com/docker/build-push-action/test/go
go 1.18
+14
View File
@@ -0,0 +1,14 @@
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, Go!")
})
log.Fatal(http.ListenAndServe(":8080", nil))
}
+20
View File
@@ -0,0 +1,20 @@
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log
RUN apk --update --no-cache add \
shadow \
sudo \
&& addgroup -g 1200 buildx \
&& adduser -u 1200 -G buildx -s /sbin/nologin -D buildx \
&& echo 'buildx ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& rm -rf /tmp/* /var/cache/apk/*
USER buildx
RUN sudo chown buildx. /log
USER root
FROM alpine
COPY --from=build /log /log
RUN ls -al /log
+9
View File
@@ -0,0 +1,9 @@
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log
FROM alpine
COPY --from=build /log /log
+4
View File
@@ -0,0 +1,4 @@
# syntax=docker/dockerfile:1
FROM debian
RUN echo "Hello debian!"
+4
View File
@@ -0,0 +1,4 @@
# syntax=docker/dockerfile:1
FROM alpine
RUN cat /etc/*release
+9
View File
@@ -0,0 +1,9 @@
# syntax=docker/dockerfile:1
FROM busybox AS base
RUN echo "Hello world!" > /hello
FROM alpine AS build
COPY --from=base /hello /hello
RUN uname -a
FROM build
+9
View File
@@ -0,0 +1,9 @@
# syntax=docker/dockerfile:1
FROM alpine
RUN apk add --no-cache curl net-tools
ARG HTTP_PROXY
ARG HTTPS_PROXY
RUN printenv HTTP_PROXY
RUN printenv HTTPS_PROXY
RUN netstat -aptn
RUN curl --retry 5 --retry-all-errors --retry-delay 0 --connect-timeout 5 --proxy $HTTP_PROXY -v --insecure --head https://www.google.com
+4
View File
@@ -0,0 +1,4 @@
# syntax=docker/dockerfile:1
FROM busybox
RUN --mount=type=secret,id=MYSECRET \
echo "MYSECRET=$(cat /run/secrets/MYSECRET)"
+3
View File
@@ -0,0 +1,3 @@
# syntax=docker/dockerfile:1
FROM busybox
RUN mount | grep /dev/shm
+3
View File
@@ -0,0 +1,3 @@
# syntax=docker/dockerfile:1
FROM busybox
RUN ulimit -a