2020-12-07 16:40:18 +03:00
# syntax = docker/dockerfile-upstream:1.2.0-labs
2019-07-06 06:20:24 +00:00
2019-08-07 01:08:27 +03:00
# Meta args applied to stage base names.
2019-07-13 00:24:51 +00:00
ARG TOOLS
2020-05-08 21:44:20 +03:00
ARG IMPORTVET
2020-09-07 16:52:26 +03:00
ARG PKGS
2020-10-30 01:08:05 +03:00
ARG EXTRAS
2020-09-07 16:52:26 +03:00
# Resolve package images using ${PKGS} to be used later in COPY --from=.
2020-09-23 14:08:47 -07:00
FROM ghcr.io/talos-systems/fhs:${PKGS} AS pkg-fhs
FROM ghcr.io/talos-systems/ca-certificates:${PKGS} AS pkg-ca-certificates
2021-01-31 18:07:05 +03:00
FROM ghcr.io/talos-systems/cryptsetup:${PKGS} AS pkg-cryptsetup
2020-09-23 14:08:47 -07:00
FROM ghcr.io/talos-systems/containerd:${PKGS} AS pkg-containerd
FROM ghcr.io/talos-systems/dosfstools:${PKGS} AS pkg-dosfstools
FROM ghcr.io/talos-systems/eudev:${PKGS} AS pkg-eudev
FROM ghcr.io/talos-systems/grub:${PKGS} AS pkg-grub
FROM ghcr.io/talos-systems/iptables:${PKGS} AS pkg-iptables
2021-01-31 18:23:09 +03:00
FROM ghcr.io/talos-systems/libjson-c:${PKGS} AS pkg-libjson-c
FROM ghcr.io/talos-systems/libpopt:${PKGS} AS pkg-libpopt
2020-09-23 14:08:47 -07:00
FROM ghcr.io/talos-systems/libressl:${PKGS} AS pkg-libressl
FROM ghcr.io/talos-systems/libseccomp:${PKGS} AS pkg-libseccomp
FROM ghcr.io/talos-systems/linux-firmware:${PKGS} AS pkg-linux-firmware
FROM ghcr.io/talos-systems/lvm2:${PKGS} AS pkg-lvm2
FROM ghcr.io/talos-systems/libaio:${PKGS} AS pkg-libaio
FROM ghcr.io/talos-systems/musl:${PKGS} AS pkg-musl
FROM ghcr.io/talos-systems/open-iscsi:${PKGS} AS pkg-open-iscsi
FROM ghcr.io/talos-systems/open-isns:${PKGS} AS pkg-open-isns
FROM ghcr.io/talos-systems/runc:${PKGS} AS pkg-runc
FROM ghcr.io/talos-systems/xfsprogs:${PKGS} AS pkg-xfsprogs
FROM ghcr.io/talos-systems/util-linux:${PKGS} AS pkg-util-linux
FROM ghcr.io/talos-systems/kmod:${PKGS} AS pkg-kmod
FROM ghcr.io/talos-systems/kernel:${PKGS} AS pkg-kernel
2020-11-25 18:00:02 +03:00
FROM ghcr.io/talos-systems/u-boot:${PKGS} AS pkg-u-boot
2020-11-28 16:52:25 -08:00
FROM ghcr.io/talos-systems/raspberrypi-firmware:${PKGS} AS pkg-raspberrypi-firmware
2019-08-07 01:08:27 +03:00
2020-10-30 01:08:05 +03:00
# Resolve package images using ${EXTRAS} to be used later in COPY --from=.
FROM ghcr.io/talos-systems/talosctl-cni-bundle-install:${EXTRAS} AS extras-talosctl-cni-bundle-install
2019-08-07 01:08:27 +03:00
# The tools target provides base toolchain for the build.
2020-05-08 21:44:20 +03:00
FROM $IMPORTVET as importvet
2019-07-13 00:24:51 +00:00
FROM $TOOLS AS tools
2019-09-10 18:12:28 +00:00
ENV PATH /toolchain/bin:/toolchain/go/bin
2019-07-13 00:24:51 +00:00
RUN [ "/toolchain/bin/mkdir" , "/bin" , "/tmp" ]
RUN [ "/toolchain/bin/ln" , "-svf" , "/toolchain/bin/bash" , "/bin/sh" ]
RUN [ "/toolchain/bin/ln" , "-svf" , "/toolchain/etc/ssl" , "/etc/ssl" ]
2021-03-12 02:17:28 +03:00
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b /toolchain/bin v1.38.0
2020-07-16 16:25:04 +03:00
ARG GOFUMPT_VERSION
2019-09-10 18:12:28 +00:00
RUN cd $( mktemp -d) \
&& go mod init tmp \
2020-07-16 16:25:04 +03:00
&& go get mvdan.cc/gofumpt/gofumports@${ GOFUMPT_VERSION } \
2019-09-12 14:32:42 +00:00
&& mv /go/bin/gofumports /toolchain/go/bin/gofumports
2021-01-10 11:25:39 +03:00
RUN curl -sfL https://github.com/uber/prototool/releases/download/v1.10.0/prototool-Linux-x86_64.tar.gz | tar -xz --strip-components= 2 -C /toolchain/bin prototool/bin/prototool
2019-11-09 15:22:43 +00:00
COPY ./hack/docgen /go/src/github.com/talos-systems/docgen
RUN cd /go/src/github.com/talos-systems/docgen \
&& go build . \
&& mv docgen /toolchain/go/bin/
2020-05-08 21:44:20 +03:00
COPY --from= importvet /importvet /toolchain/go/bin/importvet
2019-07-13 00:24:51 +00:00
# The build target creates a container that will be used to build Talos source
# code.
FROM scratch AS build
COPY --from= tools / /
SHELL [ "/toolchain/bin/bash" , "-c" ]
ENV PATH /toolchain/bin:/toolchain/go/bin
ENV GO111MODULE on
ENV GOPROXY https://proxy.golang.org
ENV CGO_ENABLED 0
2021-03-25 00:20:44 +03:00
ENV GOCACHE /.cache/go-build
ENV GOMODCACHE /.cache/mod
2019-07-13 00:24:51 +00:00
WORKDIR /src
2018-12-19 22:22:05 -08:00
2019-07-13 00:24:51 +00:00
# The generate target generates code from protobuf service definitions.
2019-01-18 06:26:12 -08:00
2019-07-13 00:24:51 +00:00
FROM build AS generate-build
2019-10-23 21:31:18 -05:00
# Common needs to be at or near the top to satisfy the subsequent imports
2020-12-23 18:08:12 +03:00
COPY ./api/vendor/ /api/vendor/
2019-10-21 13:21:46 -05:00
COPY ./api/common/common.proto /api/common/common.proto
2021-03-15 12:47:02 +03:00
RUN protoc -I/api -I/api/vendor/ --go_out= paths = source_relative:/api --go-grpc_out= paths = source_relative:/api common/common.proto
2020-01-22 22:14:58 +00:00
COPY ./api/health/health.proto /api/health/health.proto
2021-03-15 12:47:02 +03:00
RUN protoc -I/api -I/api/vendor/ --go_out= paths = source_relative:/api --go-grpc_out= paths = source_relative:/api health/health.proto
2019-10-21 13:21:46 -05:00
COPY ./api/security/security.proto /api/security/security.proto
2021-03-15 12:47:02 +03:00
RUN protoc -I/api -I/api/vendor/ --go_out= paths = source_relative:/api --go-grpc_out= paths = source_relative:/api security/security.proto
2020-11-11 09:17:46 -08:00
COPY ./api/storage/storage.proto /api/storage/storage.proto
2021-03-15 12:47:02 +03:00
RUN protoc -I/api -I/api/vendor/ --go_out= paths = source_relative:/api --go-grpc_out= paths = source_relative:/api storage/storage.proto
2019-10-21 13:21:46 -05:00
COPY ./api/machine/machine.proto /api/machine/machine.proto
2021-03-15 12:47:02 +03:00
RUN protoc -I/api -I/api/vendor/ --go_out= paths = source_relative:/api --go-grpc_out= paths = source_relative:/api machine/machine.proto
2019-10-21 13:21:46 -05:00
COPY ./api/time/time.proto /api/time/time.proto
2021-03-15 12:47:02 +03:00
RUN protoc -I/api -I/api/vendor/ --go_out= paths = source_relative:/api --go-grpc_out= paths = source_relative:/api time/time.proto
2019-10-21 13:21:46 -05:00
COPY ./api/network/network.proto /api/network/network.proto
2021-03-15 12:47:02 +03:00
RUN protoc -I/api -I/api/vendor/ --go_out= paths = source_relative:/api --go-grpc_out= paths = source_relative:/api network/network.proto
2020-07-13 23:48:41 +03:00
COPY ./api/cluster/cluster.proto /api/cluster/cluster.proto
2021-03-15 12:47:02 +03:00
RUN protoc -I/api -I/api/vendor/ --go_out= paths = source_relative:/api --go-grpc_out= paths = source_relative:/api cluster/cluster.proto
2021-01-12 15:52:24 +03:00
COPY ./api/resource/resource.proto /api/resource/resource.proto
2021-03-15 12:47:02 +03:00
RUN protoc -I/api -I/api/vendor/ --go_out= paths = source_relative:/api --go-grpc_out= paths = source_relative:/api resource/resource.proto
2021-01-19 15:45:50 +03:00
COPY ./api/inspect/inspect.proto /api/inspect/inspect.proto
2021-03-15 12:47:02 +03:00
RUN protoc -I/api -I/api/vendor/ --go_out= paths = source_relative:/api --go-grpc_out= paths = source_relative:/api inspect/inspect.proto
2019-11-09 00:08:38 +03:00
# Gofumports generated files to adjust import order
RUN gofumports -w -local github.com/talos-systems/talos /api/
2019-07-21 18:27:15 +00:00
2020-10-20 22:05:13 +03:00
# run docgen for machinery config
COPY ./pkg/machinery /pkg/machinery
WORKDIR /pkg/machinery
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache go generate /pkg/machinery/config/types/v1alpha1/
2020-10-20 22:05:13 +03:00
WORKDIR /
2019-07-13 00:24:51 +00:00
FROM scratch AS generate
2021-01-10 11:25:39 +03:00
COPY --from= generate-build /api/common/*.pb.go /pkg/machinery/api/common/
COPY --from= generate-build /api/health/*.pb.go /pkg/machinery/api/health/
COPY --from= generate-build /api/security/*.pb.go /pkg/machinery/api/security/
COPY --from= generate-build /api/machine/*.pb.go /pkg/machinery/api/machine/
COPY --from= generate-build /api/time/*.pb.go /pkg/machinery/api/time/
COPY --from= generate-build /api/network/*.pb.go /pkg/machinery/api/network/
COPY --from= generate-build /api/cluster/*.pb.go /pkg/machinery/api/cluster/
COPY --from= generate-build /api/storage/*.pb.go /pkg/machinery/api/storage/
2021-01-12 15:52:24 +03:00
COPY --from= generate-build /api/resource/*.pb.go /pkg/machinery/api/resource/
2021-01-19 15:45:50 +03:00
COPY --from= generate-build /api/inspect/*.pb.go /pkg/machinery/api/inspect/
2020-10-20 22:05:13 +03:00
COPY --from= generate-build /pkg/machinery/config/types/v1alpha1/*_doc.go /pkg/machinery/config/types/v1alpha1/
2019-03-28 02:33:03 +03:00
2019-07-13 00:24:51 +00:00
# The base target provides a container that can be used to build all Talos
# assets.
2019-01-18 06:26:12 -08:00
2019-07-13 00:24:51 +00:00
FROM build AS base
2020-08-17 19:12:47 +03:00
COPY ./go.mod ./go.sum ./
COPY ./pkg/machinery/go.mod ./pkg/machinery/go.sum ./pkg/machinery/
2021-03-12 13:59:27 +03:00
WORKDIR /src/pkg/machinery
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache go mod download
2021-03-12 13:59:27 +03:00
WORKDIR /src
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache go mod download
RUN --mount= type = cache,target= /.cache go mod verify
2019-04-11 02:50:56 +03:00
COPY ./cmd ./cmd
COPY ./pkg ./pkg
COPY ./internal ./internal
2020-08-17 19:12:47 +03:00
COPY --from= generate /pkg/machinery/api ./pkg/machinery/api
2020-10-20 22:05:13 +03:00
COPY --from= generate /pkg/machinery/config ./pkg/machinery/config
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache go list -mod= readonly all >/dev/null
RUN --mount= type = cache,target= /.cache ! go mod tidy -v 2>& 1 | grep .
2020-11-09 23:10:19 +03:00
WORKDIR /src/pkg/machinery
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache go mod download
RUN --mount= type = cache,target= /.cache go list -mod= readonly all >/dev/null
RUN --mount= type = cache,target= /.cache ! go mod tidy -v 2>& 1 | grep .
2020-11-09 23:10:19 +03:00
WORKDIR /src
2018-12-19 22:22:05 -08:00
2019-07-13 00:24:51 +00:00
# The init target builds the init binary.
FROM base AS init-build
ARG SHA
ARG TAG
2020-09-28 21:37:57 +03:00
ARG PKGS
2020-10-08 22:46:55 +03:00
ARG EXTRAS
2019-08-01 23:01:31 +00:00
ARG VERSION_PKG = "github.com/talos-systems/talos/pkg/version"
2019-07-13 00:24:51 +00:00
WORKDIR /src/internal/app/init
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache go build -ldflags " -s -w -X ${ VERSION_PKG } .Name=Talos -X ${ VERSION_PKG } .SHA= ${ SHA } -X ${ VERSION_PKG } .Tag= ${ TAG } -X ${ VERSION_PKG } .PkgsVersion= ${ PKGS } -X ${ VERSION_PKG } .ExtrasVersion= ${ EXTRAS } " -o /init
2019-07-13 00:24:51 +00:00
RUN chmod +x /init
2019-07-21 18:27:15 +00:00
2019-07-13 00:24:51 +00:00
FROM scratch AS init
COPY --from= init-build /init /init
2021-03-22 23:47:35 +03:00
# The machined target builds the machined binary.
2019-07-16 15:09:35 +00:00
FROM base AS machined-build
ARG SHA
ARG TAG
2020-09-28 21:37:57 +03:00
ARG PKGS
2020-10-08 22:46:55 +03:00
ARG EXTRAS
2020-09-18 20:34:59 -07:00
ARG USERNAME
ARG REGISTRY
2019-08-01 23:01:31 +00:00
ARG VERSION_PKG = "github.com/talos-systems/talos/pkg/version"
2020-09-25 00:24:33 +03:00
ARG IMAGES_PKGS = "github.com/talos-systems/talos/pkg/images"
2019-07-16 15:09:35 +00:00
WORKDIR /src/internal/app/machined
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache go build -ldflags " -s -w -X ${ VERSION_PKG } .Name=Talos -X ${ VERSION_PKG } .SHA= ${ SHA } -X ${ VERSION_PKG } .Tag= ${ TAG } -X ${ VERSION_PKG } .PkgsVersion= ${ PKGS } -X ${ VERSION_PKG } .ExtrasVersion= ${ EXTRAS } -X ${ IMAGES_PKGS } .Username= ${ USERNAME } -X ${ IMAGES_PKGS } .Registry= ${ REGISTRY } " -o /machined
2019-07-16 15:09:35 +00:00
RUN chmod +x /machined
2019-07-21 18:27:15 +00:00
2019-07-16 15:09:35 +00:00
FROM scratch AS machined
COPY --from= machined-build /machined /machined
2020-03-20 17:38:48 -07:00
# The talosctl targets build the talosctl binaries.
2019-01-18 06:26:12 -08:00
2020-03-21 14:27:03 -07:00
FROM base AS talosctl-linux-amd64-build
2018-12-19 22:22:05 -08:00
ARG SHA
ARG TAG
2020-09-28 21:37:57 +03:00
ARG PKGS
2020-10-08 22:46:55 +03:00
ARG EXTRAS
2019-12-27 20:49:24 +00:00
ARG ARTIFACTS
2020-08-18 15:52:26 -07:00
ARG USERNAME
ARG REGISTRY
2019-08-01 23:01:31 +00:00
ARG VERSION_PKG = "github.com/talos-systems/talos/pkg/version"
2020-09-25 00:24:33 +03:00
ARG IMAGES_PKGS = "github.com/talos-systems/talos/pkg/images"
2020-03-20 17:38:48 -07:00
ARG MGMT_HELPERS_PKG = "github.com/talos-systems/talos/cmd/talosctl/pkg/mgmt/helpers"
WORKDIR /src/cmd/talosctl
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache GOOS = linux GOARCH = amd64 go build -ldflags " -s -w -X ${ VERSION_PKG } .Name=Client -X ${ VERSION_PKG } .SHA= ${ SHA } -X ${ VERSION_PKG } .Tag= ${ TAG } -X ${ VERSION_PKG } .PkgsVersion= ${ PKGS } -X ${ VERSION_PKG } .ExtrasVersion= ${ EXTRAS } -X ${ IMAGES_PKGS } .Username= ${ USERNAME } -X ${ IMAGES_PKGS } .Registry= ${ REGISTRY } -X ${ MGMT_HELPERS_PKG } .ArtifactsPath= ${ ARTIFACTS } " -o /talosctl-linux-amd64
2020-03-20 17:38:48 -07:00
RUN chmod +x /talosctl-linux-amd64
2019-07-21 18:27:15 +00:00
2020-03-21 14:27:03 -07:00
FROM base AS talosctl-linux-arm64-build
ARG SHA
ARG TAG
2020-09-28 21:37:57 +03:00
ARG PKGS
2020-10-08 22:46:55 +03:00
ARG EXTRAS
2020-03-21 14:27:03 -07:00
ARG ARTIFACTS
2020-08-18 15:52:26 -07:00
ARG USERNAME
ARG REGISTRY
2020-03-21 14:27:03 -07:00
ARG VERSION_PKG = "github.com/talos-systems/talos/pkg/version"
2020-09-25 00:24:33 +03:00
ARG IMAGES_PKGS = "github.com/talos-systems/talos/pkg/images"
2020-03-21 14:27:03 -07:00
ARG MGMT_HELPERS_PKG = "github.com/talos-systems/talos/cmd/talosctl/pkg/mgmt/helpers"
WORKDIR /src/cmd/talosctl
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache GOOS = linux GOARCH = arm64 go build -ldflags " -s -w -X ${ VERSION_PKG } .Name=Client -X ${ VERSION_PKG } .SHA= ${ SHA } -X ${ VERSION_PKG } .Tag= ${ TAG } -X ${ VERSION_PKG } .PkgsVersion= ${ PKGS } -X ${ VERSION_PKG } .ExtrasVersion= ${ EXTRAS } -X ${ IMAGES_PKGS } .Username= ${ USERNAME } -X ${ IMAGES_PKGS } .Registry= ${ REGISTRY } -X ${ MGMT_HELPERS_PKG } .ArtifactsPath= ${ ARTIFACTS } " -o /talosctl-linux-arm64
2020-03-21 14:27:03 -07:00
RUN chmod +x /talosctl-linux-arm64
2020-03-21 18:08:09 -07:00
FROM base AS talosctl-linux-armv7-build
ARG SHA
ARG TAG
2020-09-28 21:37:57 +03:00
ARG PKGS
2020-10-08 22:46:55 +03:00
ARG EXTRAS
2020-03-21 18:08:09 -07:00
ARG ARTIFACTS
2020-08-18 15:52:26 -07:00
ARG USERNAME
ARG REGISTRY
2020-03-21 18:08:09 -07:00
ARG VERSION_PKG = "github.com/talos-systems/talos/pkg/version"
2020-09-25 00:24:33 +03:00
ARG IMAGES_PKGS = "github.com/talos-systems/talos/pkg/images"
2020-03-21 18:08:09 -07:00
ARG MGMT_HELPERS_PKG = "github.com/talos-systems/talos/cmd/talosctl/pkg/mgmt/helpers"
WORKDIR /src/cmd/talosctl
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache GOOS = linux GOARCH = arm GOARM = 7 go build -ldflags " -s -w -X ${ VERSION_PKG } .Name=Client -X ${ VERSION_PKG } .SHA= ${ SHA } -X ${ VERSION_PKG } .Tag= ${ TAG } -X ${ VERSION_PKG } .PkgsVersion= ${ PKGS } -X ${ VERSION_PKG } .ExtrasVersion= ${ EXTRAS } -X ${ IMAGES_PKGS } .Username= ${ USERNAME } -X ${ IMAGES_PKGS } .Registry= ${ REGISTRY } -X ${ MGMT_HELPERS_PKG } .ArtifactsPath= ${ ARTIFACTS } " -o /talosctl-linux-armv7
2020-03-21 18:08:09 -07:00
RUN chmod +x /talosctl-linux-armv7
2020-03-20 17:38:48 -07:00
FROM scratch AS talosctl-linux
2020-03-21 14:27:03 -07:00
COPY --from= talosctl-linux-amd64-build /talosctl-linux-amd64 /talosctl-linux-amd64
COPY --from= talosctl-linux-arm64-build /talosctl-linux-arm64 /talosctl-linux-arm64
2020-03-21 18:08:09 -07:00
COPY --from= talosctl-linux-armv7-build /talosctl-linux-armv7 /talosctl-linux-armv7
2019-04-18 19:31:43 -07:00
2021-03-18 11:46:32 -05:00
FROM scratch as talosctl
ARG TARGETARCH
COPY --from= talosctl-linux /talosctl-linux-${ TARGETARCH } /talosctl
ARG TAG
ENV VERSION ${ TAG }
LABEL "alpha.talos.dev/version" = " ${ VERSION } "
LABEL org.opencontainers.image.source https://github.com/talos-systems/talos
ENTRYPOINT [ "/talosctl" ]
2020-03-20 17:38:48 -07:00
FROM base AS talosctl-darwin-build
2019-04-18 19:31:43 -07:00
ARG SHA
ARG TAG
2020-09-28 21:37:57 +03:00
ARG PKGS
2020-10-08 22:46:55 +03:00
ARG EXTRAS
2019-12-27 20:49:24 +00:00
ARG ARTIFACTS
2020-08-18 15:52:26 -07:00
ARG USERNAME
ARG REGISTRY
2019-08-01 23:01:31 +00:00
ARG VERSION_PKG = "github.com/talos-systems/talos/pkg/version"
2020-09-25 00:24:33 +03:00
ARG IMAGES_PKGS = "github.com/talos-systems/talos/pkg/images"
2020-03-20 17:38:48 -07:00
ARG MGMT_HELPERS_PKG = "github.com/talos-systems/talos/cmd/talosctl/pkg/mgmt/helpers"
WORKDIR /src/cmd/talosctl
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache GOOS = darwin GOARCH = amd64 go build -ldflags " -s -w -X ${ VERSION_PKG } .Name=Client -X ${ VERSION_PKG } .SHA= ${ SHA } -X ${ VERSION_PKG } .Tag= ${ TAG } -X ${ VERSION_PKG } .PkgsVersion= ${ PKGS } -X ${ VERSION_PKG } .ExtrasVersion= ${ EXTRAS } -X ${ IMAGES_PKGS } .Username= ${ USERNAME } -X ${ IMAGES_PKGS } .Registry= ${ REGISTRY } -X ${ MGMT_HELPERS_PKG } .ArtifactsPath= ${ ARTIFACTS } " -o /talosctl-darwin-amd64
2020-03-20 17:38:48 -07:00
RUN chmod +x /talosctl-darwin-amd64
2019-07-21 18:27:15 +00:00
2020-03-20 17:38:48 -07:00
FROM scratch AS talosctl-darwin
COPY --from= talosctl-darwin-build /talosctl-darwin-amd64 /talosctl-darwin-amd64
2019-04-18 19:31:43 -07:00
# The kernel target is the linux kernel.
2019-07-13 00:24:51 +00:00
FROM scratch AS kernel
2020-09-26 00:00:43 +03:00
ARG TARGETARCH
COPY --from= pkg-kernel /boot/vmlinuz /vmlinuz-${ TARGETARCH }
2019-04-18 19:31:43 -07:00
2019-07-21 18:27:15 +00:00
# The rootfs target provides the Talos rootfs.
2019-04-18 19:31:43 -07:00
2019-07-21 18:27:15 +00:00
FROM build AS rootfs-base
2020-09-07 16:52:26 +03:00
COPY --from= pkg-fhs / /rootfs
COPY --from= pkg-ca-certificates / /rootfs
2021-01-31 18:07:05 +03:00
COPY --from= pkg-cryptsetup / /rootfs
2020-09-07 16:52:26 +03:00
COPY --from= pkg-containerd / /rootfs
COPY --from= pkg-dosfstools / /rootfs
COPY --from= pkg-eudev / /rootfs
COPY --from= pkg-iptables / /rootfs
2021-01-31 18:23:09 +03:00
COPY --from= pkg-libjson-c / /rootfs
COPY --from= pkg-libpopt / /rootfs
2020-09-07 16:52:26 +03:00
COPY --from= pkg-libressl / /rootfs
COPY --from= pkg-libseccomp / /rootfs
COPY --from= pkg-linux-firmware /lib/firmware/bnx2 /rootfs/lib/firmware/bnx2
COPY --from= pkg-linux-firmware /lib/firmware/bnx2x /rootfs/lib/firmware/bnx2x
COPY --from= pkg-lvm2 / /rootfs
COPY --from= pkg-libaio / /rootfs
COPY --from= pkg-musl / /rootfs
COPY --from= pkg-open-iscsi / /rootfs
COPY --from= pkg-open-isns / /rootfs
COPY --from= pkg-runc / /rootfs
COPY --from= pkg-xfsprogs / /rootfs
COPY --from= pkg-util-linux /lib/libblkid.* /rootfs/lib/
COPY --from= pkg-util-linux /lib/libuuid.* /rootfs/lib/
COPY --from= pkg-util-linux /lib/libmount.* /rootfs/lib/
COPY --from= pkg-kmod /usr/lib/libkmod.* /rootfs/lib/
COPY --from= pkg-kernel /lib/modules /rootfs/lib/modules
2019-07-21 18:27:15 +00:00
COPY --from= machined /machined /rootfs/sbin/init
2019-07-25 21:38:20 +00:00
# NB: We run the cleanup step before creating extra directories, files, and
# symlinks to avoid accidentally cleaning them up.
COPY ./hack/cleanup.sh /toolchain/bin/cleanup.sh
RUN cleanup.sh /rootfs
2019-12-04 23:20:17 +00:00
COPY hack/containerd.toml /rootfs/etc/cri/containerd.toml
2019-07-21 18:27:15 +00:00
RUN touch /rootfs/etc/resolv.conf
RUN touch /rootfs/etc/hosts
RUN touch /rootfs/etc/os-release
2020-06-30 20:48:46 -07:00
RUN mkdir -pv /rootfs/{ boot,usr/local/share,mnt,system}
2019-07-21 18:27:15 +00:00
RUN mkdir -pv /rootfs/{ etc/kubernetes/manifests,etc/cni,usr/libexec/kubernetes}
RUN ln -s /etc/ssl /rootfs/etc/pki
RUN ln -s /etc/ssl /rootfs/usr/share/ca-certificates
RUN ln -s /etc/ssl /rootfs/usr/local/share/ca-certificates
RUN ln -s /etc/ssl /rootfs/etc/ca-certificates
2021-03-23 21:01:44 +03:00
RUN mkdir -pv /rootfs/opt/{ apid,timed,trustd}
2021-03-22 23:47:35 +03:00
RUN ln /rootfs/sbin/init /rootfs/opt/apid/apid
RUN ln /rootfs/sbin/init /rootfs/opt/timed/timed
RUN ln /rootfs/sbin/init /rootfs/opt/trustd/trustd
2019-07-13 00:24:51 +00:00
2019-07-21 18:27:15 +00:00
FROM rootfs-base AS rootfs-squashfs
2019-07-27 08:09:50 +00:00
RUN mksquashfs /rootfs /rootfs.sqsh -all-root -noappend -comp xz -Xdict-size 100% -no-progress
2019-04-18 19:31:43 -07:00
2019-10-30 22:52:36 +00:00
FROM scratch AS squashfs
COPY --from= rootfs-squashfs /rootfs.sqsh /
2019-04-18 19:31:43 -07:00
FROM scratch AS rootfs
2019-07-21 18:27:15 +00:00
COPY --from= rootfs-base /rootfs /
# The initramfs target provides the Talos initramfs image.
FROM build AS initramfs-archive
WORKDIR /initramfs
2019-10-30 22:52:36 +00:00
COPY --from= squashfs /rootfs.sqsh .
2019-07-21 18:27:15 +00:00
COPY --from= init /init .
RUN set -o pipefail && find . 2>/dev/null | cpio -H newc -o | xz -v -C crc32 -0 -e -T 0 -z >/initramfs.xz
FROM scratch AS initramfs
2020-09-26 00:00:43 +03:00
ARG TARGETARCH
COPY --from= initramfs-archive /initramfs.xz /initramfs-${ TARGETARCH } .xz
2019-04-18 19:31:43 -07:00
2019-12-24 12:23:52 -08:00
# The talos target generates a docker image that can be used to run Talos
2019-04-18 19:31:43 -07:00
# in containers.
2019-12-24 12:23:52 -08:00
FROM scratch AS talos
2019-07-21 18:27:15 +00:00
COPY --from= rootfs / /
2020-10-19 22:52:21 +03:00
LABEL org.opencontainers.image.source https://github.com/talos-systems/talos
2019-07-21 18:27:15 +00:00
ENTRYPOINT [ "/sbin/init" ]
2019-04-18 19:31:43 -07:00
2019-05-15 16:14:30 -07:00
# The installer target generates an image that can be used to install Talos to
# various environments.
2019-04-18 19:31:43 -07:00
2019-11-01 04:55:58 +00:00
FROM base AS installer-build
ARG SHA
ARG TAG
2020-09-28 21:37:57 +03:00
ARG PKGS
2020-10-08 22:46:55 +03:00
ARG EXTRAS
2020-09-18 20:34:59 -07:00
ARG USERNAME
ARG REGISTRY
2019-11-01 04:55:58 +00:00
ARG VERSION_PKG = "github.com/talos-systems/talos/pkg/version"
2020-09-25 00:24:33 +03:00
ARG IMAGES_PKGS = "github.com/talos-systems/talos/pkg/images"
2019-11-01 04:55:58 +00:00
WORKDIR /src/cmd/installer
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache go build -ldflags " -s -w -X ${ VERSION_PKG } .Name=Talos -X ${ VERSION_PKG } .SHA= ${ SHA } -X ${ VERSION_PKG } .Tag= ${ TAG } -X ${ VERSION_PKG } .PkgsVersion= ${ PKGS } -X ${ VERSION_PKG } .ExtrasVersion= ${ EXTRAS } -X ${ IMAGES_PKGS } .Username= ${ USERNAME } -X ${ IMAGES_PKGS } .Registry= ${ REGISTRY } " -o /installer
2019-11-01 04:55:58 +00:00
RUN chmod +x /installer
2021-02-24 16:40:22 +03:00
FROM alpine:3.13.2 AS unicode-pf2
2020-10-31 14:03:56 -07:00
RUN apk add --no-cache --update grub
2021-02-24 16:40:22 +03:00
FROM alpine:3.13.2 AS installer
2019-10-30 22:52:36 +00:00
RUN apk add --no-cache --update \
2019-06-25 19:25:57 -07:00
bash \
2019-09-23 03:42:35 -07:00
ca-certificates \
2020-08-18 15:52:26 -07:00
efibootmgr \
2020-10-31 14:03:56 -07:00
mtools \
2019-06-25 19:25:57 -07:00
qemu-img \
util-linux \
2020-10-31 14:03:56 -07:00
xfsprogs \
xorriso \
xz
2020-09-07 16:52:26 +03:00
COPY --from= pkg-grub / /
2020-10-31 14:03:56 -07:00
COPY --from= unicode-pf2 /usr/share/grub/unicode.pf2 /usr/share/grub/unicode.pf2
2020-09-26 00:00:43 +03:00
ARG TARGETARCH
COPY --from= kernel /vmlinuz-${ TARGETARCH } /usr/install/vmlinuz
2020-11-30 17:09:02 -08:00
COPY --from= pkg-kernel /dtb /usr/install/dtb
2020-09-26 00:00:43 +03:00
COPY --from= initramfs /initramfs-${ TARGETARCH } .xz /usr/install/initramfs.xz
2020-11-25 18:00:02 +03:00
COPY --from= pkg-u-boot / /usr/install/u-boot
2020-11-28 16:52:25 -08:00
COPY --from= pkg-raspberrypi-firmware / /usr/install/raspberrypi-firmware
2019-11-01 04:55:58 +00:00
COPY --from= installer-build /installer /bin/installer
2020-03-20 17:38:48 -07:00
RUN ln -s /bin/installer /bin/talosctl
2019-04-18 19:31:43 -07:00
ARG TAG
ENV VERSION ${ TAG }
2019-12-29 19:43:40 -08:00
LABEL "alpha.talos.dev/version" = " ${ VERSION } "
2020-10-19 22:52:21 +03:00
LABEL org.opencontainers.image.source https://github.com/talos-systems/talos
2019-11-01 04:55:58 +00:00
ENTRYPOINT [ "/bin/installer" ]
2019-11-04 06:28:10 +00:00
ONBUILD RUN apk add --no-cache --update \
cpio \
squashfs-tools \
xz
2019-10-30 22:52:36 +00:00
ONBUILD WORKDIR /initramfs
ONBUILD ARG RM
ONBUILD RUN xz -d /usr/install/initramfs.xz \
&& cpio -idvm < /usr/install/initramfs \
&& unsquashfs -f -d /rootfs rootfs.sqsh \
&& for f in ${ RM } ; do rm -rfv /rootfs$f ; done \
&& rm /usr/install/initramfs \
&& rm rootfs.sqsh
ONBUILD COPY --from= customization / /rootfs
ONBUILD RUN find /rootfs \
&& mksquashfs /rootfs rootfs.sqsh -all-root -noappend -comp xz -Xdict-size 100% -no-progress \
&& set -o pipefail && find . 2>/dev/null | cpio -H newc -o | xz -v -C crc32 -0 -e -T 0 -z >/usr/install/initramfs.xz \
&& rm -rf /rootfs \
&& rm -rf /initramfs
ONBUILD WORKDIR /
2019-07-13 00:24:51 +00:00
# The test target performs tests on the source code.
2019-08-09 03:45:13 +00:00
FROM base AS unit-tests-runner
2019-07-13 00:24:51 +00:00
RUN unlink /etc/ssl
2019-07-21 18:27:15 +00:00
COPY --from= rootfs / /
2019-07-23 17:17:16 +03:00
ARG TESTPKGS
2021-03-25 00:20:44 +03:00
ENV PLATFORM container
RUN --security= insecure --mount= type = cache,id= testspace,target= /tmp --mount= type = cache,target= /.cache go test -v -covermode= atomic -coverprofile= coverage.txt -count 1 -p 4 ${ TESTPKGS }
2019-08-09 03:45:13 +00:00
FROM scratch AS unit-tests
COPY --from= unit-tests-runner /src/coverage.txt /coverage.txt
2019-07-13 00:24:51 +00:00
2019-08-09 03:45:13 +00:00
# The unit-tests-race target performs tests with race detector.
2019-08-07 01:08:27 +03:00
2020-05-22 23:26:56 +03:00
FROM base AS unit-tests-race
RUN unlink /etc/ssl
COPY --from= rootfs / /
2019-08-07 01:08:27 +03:00
ARG TESTPKGS
2021-03-25 00:20:44 +03:00
ENV PLATFORM container
ENV CGO_ENABLED 1
RUN --security= insecure --mount= type = cache,id= testspace,target= /tmp --mount= type = cache,target= /.cache go test -v -race -count 1 -p 4 ${ TESTPKGS }
2019-08-07 01:08:27 +03:00
2019-10-25 22:57:52 +03:00
# The integration-test target builds integration test binary.
2020-01-04 13:19:34 -08:00
FROM base AS integration-test-linux-build
2019-10-25 22:57:52 +03:00
ARG SHA
ARG TAG
2020-09-28 21:37:57 +03:00
ARG PKGS
2020-10-08 22:46:55 +03:00
ARG EXTRAS
2020-08-18 15:52:26 -07:00
ARG USERNAME
ARG REGISTRY
2019-10-25 22:57:52 +03:00
ARG VERSION_PKG = "github.com/talos-systems/talos/pkg/version"
2020-09-25 00:24:33 +03:00
ARG IMAGES_PKGS = "github.com/talos-systems/talos/pkg/images"
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache GOOS = linux GOARCH = amd64 go test -c \
2020-10-08 22:46:55 +03:00
-ldflags " -s -w -X ${ VERSION_PKG } .Name=Client -X ${ VERSION_PKG } .SHA= ${ SHA } -X ${ VERSION_PKG } .Tag= ${ TAG } -X ${ IMAGES_PKGS } .Username= ${ USERNAME } -X ${ VERSION_PKG } .PkgsVersion= ${ PKGS } -X ${ VERSION_PKG } .ExtrasVersion= ${ EXTRAS } -X ${ IMAGES_PKGS } .Registry= ${ REGISTRY } " \
2019-11-06 14:32:07 +03:00
-tags integration,integration_api,integration_cli,integration_k8s \
2019-10-25 22:57:52 +03:00
./internal/integration
2020-01-04 13:19:34 -08:00
FROM scratch AS integration-test-linux
COPY --from= integration-test-linux-build /src/integration.test /integration-test-linux-amd64
FROM base AS integration-test-darwin-build
ARG SHA
ARG TAG
2020-09-28 21:37:57 +03:00
ARG PKGS
2020-10-08 22:46:55 +03:00
ARG EXTRAS
2020-08-18 15:52:26 -07:00
ARG USERNAME
ARG REGISTRY
2020-01-04 13:19:34 -08:00
ARG VERSION_PKG = "github.com/talos-systems/talos/pkg/version"
2020-09-25 00:24:33 +03:00
ARG IMAGES_PKGS = "github.com/talos-systems/talos/pkg/images"
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache GOOS = darwin GOARCH = amd64 go test -c \
2020-10-08 22:46:55 +03:00
-ldflags " -s -w -X ${ VERSION_PKG } .Name=Client -X ${ VERSION_PKG } .SHA= ${ SHA } -X ${ VERSION_PKG } .Tag= ${ TAG } -X ${ IMAGES_PKGS } .Username= ${ USERNAME } -X ${ VERSION_PKG } .PkgsVersion= ${ PKGS } -X ${ VERSION_PKG } .ExtrasVersion= ${ EXTRAS } -X ${ IMAGES_PKGS } .Registry= ${ REGISTRY } " \
2020-01-04 13:19:34 -08:00
-tags integration,integration_api,integration_cli,integration_k8s \
./internal/integration
FROM scratch AS integration-test-darwin
COPY --from= integration-test-darwin-build /src/integration.test /integration-test-darwin-amd64
2019-10-25 22:57:52 +03:00
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
# The integration-test-provision target builds integration test binary with provisioning tests.
FROM base AS integration-test-provision-linux-build
ARG SHA
ARG TAG
2020-09-28 21:37:57 +03:00
ARG PKGS
2020-10-08 22:46:55 +03:00
ARG EXTRAS
2020-08-18 15:52:26 -07:00
ARG USERNAME
ARG REGISTRY
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
ARG VERSION_PKG = "github.com/talos-systems/talos/pkg/version"
2020-09-25 00:24:33 +03:00
ARG IMAGES_PKGS = "github.com/talos-systems/talos/pkg/images"
2020-03-20 17:38:48 -07:00
ARG MGMT_HELPERS_PKG = "github.com/talos-systems/talos/cmd/talosctl/pkg/mgmt/helpers"
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
ARG ARTIFACTS
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache GOOS = linux GOARCH = amd64 go test -c \
2020-10-08 22:46:55 +03:00
-ldflags " -s -w -X ${ VERSION_PKG } .Name=Client -X ${ VERSION_PKG } .SHA= ${ SHA } -X ${ VERSION_PKG } .Tag= ${ TAG } -X ${ VERSION_PKG } .PkgsVersion= ${ PKGS } -X ${ VERSION_PKG } .ExtrasVersion= ${ EXTRAS } -X ${ IMAGES_PKGS } .Username= ${ USERNAME } -X ${ IMAGES_PKGS } .Registry= ${ REGISTRY } -X ${ MGMT_HELPERS_PKG } .ArtifactsPath= ${ ARTIFACTS } " \
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
-tags integration,integration_provision \
./internal/integration
FROM scratch AS integration-test-provision-linux
COPY --from= integration-test-provision-linux-build /src/integration.test /integration-test-provision-linux-amd64
2019-07-13 00:24:51 +00:00
# The lint target performs linting on the source code.
2019-12-24 09:28:58 -08:00
FROM base AS lint-go
2020-02-17 16:45:30 -08:00
COPY .golangci.yml .
2021-03-25 00:20:44 +03:00
ENV GOGC 50
ENV GOLANCGCI_LINT_CACHE /.cache/lint
RUN --mount= type = cache,target= /.cache golangci-lint run --config .golangci.yml
2020-08-17 19:12:47 +03:00
WORKDIR /src/pkg/machinery
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache golangci-lint run --config ../../.golangci.yml
2020-08-17 19:12:47 +03:00
WORKDIR /src
2021-03-25 00:20:44 +03:00
RUN --mount= type = cache,target= /.cache importvet github.com/talos-systems/talos/...
2019-09-10 18:12:28 +00:00
RUN find . -name '*.pb.go' | xargs rm
2019-09-12 14:32:42 +00:00
RUN FILES = " $( gofumports -l -local github.com/talos-systems/talos .) " && test -z " ${ FILES } " || ( echo -e " Source code is not formatted with 'gofumports -w -local github.com/talos-systems/talos .':\n ${ FILES } " ; exit 1)
2019-08-17 08:51:40 +00:00
2020-04-28 21:10:19 -07:00
# The protolint target performs linting on protobuf files.
2019-08-27 21:45:59 +00:00
2019-12-24 09:28:58 -08:00
FROM base AS lint-protobuf
2020-04-28 21:10:19 -07:00
WORKDIR /src/api
COPY api .
COPY prototool.yaml .
RUN prototool lint --protoc-bin-path= /toolchain/bin/protoc --protoc-wkt-path= /toolchain/include
2019-08-27 21:45:59 +00:00
2019-08-17 08:51:40 +00:00
# The markdownlint target performs linting on Markdown files.
2021-03-22 09:29:13 +03:00
FROM node:15.12.0-alpine AS lint-markdown
2020-11-03 21:52:06 -08:00
RUN apk add --no-cache findutils
2020-07-23 11:21:42 -07:00
RUN npm i -g markdownlint-cli@0.23.2
RUN npm i -g textlint@11.7.6
2020-05-06 15:40:07 +00:00
RUN npm i -g textlint-rule-one-sentence-per-line@1.0.2
2019-08-17 08:51:40 +00:00
WORKDIR /src
2020-04-26 20:07:08 -07:00
COPY . .
2020-11-03 21:52:06 -08:00
RUN markdownlint \
--ignore '**/LICENCE.md' \
--ignore '**/CHANGELOG.md' \
--ignore '**/CODE_OF_CONDUCT.md' \
--ignore '**/node_modules/**' \
--ignore '**/hack/chglog/**' \
2020-11-04 09:28:37 -08:00
--ignore 'website/content/docs/*/Reference/*' .
2020-11-03 21:52:06 -08:00
RUN find . \
-name '*.md' \
-not -path './LICENCE.md' \
-not -path './CHANGELOG.md' \
-not -path './CODE_OF_CONDUCT.md' \
-not -path '*/node_modules/*' \
-not -path './hack/chglog/**' \
-not -path './website/content/docs/*/Reference/*' \
| xargs textlint --rule one-sentence-per-line --stdin-filename
2019-12-24 12:23:52 -08:00
# The docs target generates documentation.
FROM base AS docs-build
2020-08-17 19:12:47 +03:00
WORKDIR /src
2020-03-20 17:38:48 -07:00
COPY --from= talosctl-linux /talosctl-linux-amd64 /bin/talosctl
2020-10-22 19:39:37 -07:00
RUN env HOME = /home/user TAG = latest /bin/talosctl docs --config /tmp \
&& env HOME = /home/user TAG = latest /bin/talosctl docs --cli /tmp
FROM pseudomuto/protoc-gen-doc as proto-docs-build
COPY --from= generate-build /api /protos
COPY ./hack/protoc-gen-doc/markdown.tmpl /tmp/markdown.tmpl
RUN protoc \
-I/protos \
-I/protos/common \
-I/protos/health \
2021-01-19 15:45:50 +03:00
-I/protos/inspect \
2020-10-22 19:39:37 -07:00
-I/protos/machine \
-I/protos/network \
2021-01-12 15:52:24 +03:00
-I/protos/resource \
2020-10-22 19:39:37 -07:00
-I/protos/security \
2020-11-11 09:17:46 -08:00
-I/protos/storage \
2020-10-22 19:39:37 -07:00
-I/protos/time \
2020-12-23 18:08:12 +03:00
-I/protos/vendor \
2020-10-22 19:39:37 -07:00
--doc_opt= /tmp/markdown.tmpl,api.md \
--doc_out= /tmp \
2020-12-23 18:08:12 +03:00
/protos/common/*.proto \
2020-10-22 19:39:37 -07:00
/protos/health/*.proto \
2021-01-19 15:45:50 +03:00
/protos/inspect/*.proto \
2020-10-22 19:39:37 -07:00
/protos/machine/*.proto \
/protos/network/*.proto \
2021-01-12 15:52:24 +03:00
/protos/resource/*.proto \
2020-10-22 19:39:37 -07:00
/protos/security/*.proto \
2020-11-11 09:17:46 -08:00
/protos/storage/*.proto \
2020-10-22 19:39:37 -07:00
/protos/time/*.proto
2019-12-24 12:23:52 -08:00
FROM scratch AS docs
2021-03-22 15:51:25 +03:00
COPY --from= docs-build /tmp/configuration.md /website/content/docs/v0.10/Reference/
COPY --from= docs-build /tmp/cli.md /website/content/docs/v0.10/Reference/
COPY --from= proto-docs-build /tmp/api.md /website/content/docs/v0.10/Reference/
2020-10-30 01:08:05 +03:00
# The talosctl-cni-bundle builds the CNI bundle for talosctl.
FROM scratch AS talosctl-cni-bundle
ARG TARGETARCH
COPY --from= extras-talosctl-cni-bundle-install /opt/cni/bin/ /talosctl-cni-bundle-${ TARGETARCH } /