This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add built-in containerd and new build target for it
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
- Loading branch information
Showing
394 changed files
with
75,868 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM golang:1.12.9 as build | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y btrfs-tools libseccomp-dev | ||
RUN mkdir /output | ||
|
||
# Build static containerd with preload plugins | ||
COPY . /go/src/github.com/weaveworks/ignite | ||
WORKDIR /go/src/github.com/weaveworks/ignite | ||
RUN GO111MODULE=on go build -mod=vendor -buildmode=pie -tags "netgo osusergo static_build" -ldflags '-extldflags "-fno-PIC -static"' -o /output/containerd ./cmd/containerd | ||
|
||
# Build static shim | ||
RUN go get -u github.com/containerd/containerd | ||
RUN (cd /go/src/github.com/containerd/containerd && git checkout v1.3.0-rc.0) | ||
WORKDIR /go/src/github.com/containerd/containerd | ||
RUN GO111MODULE=off CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -o /output/containerd-shim ./cmd/containerd-shim | ||
RUN GO111MODULE=off CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -o /output/containerd-shim-runc-v1 ./cmd/containerd-shim-runc-v1 | ||
|
||
# Build static runc | ||
RUN go get -u github.com/opencontainers/runc | ||
RUN (cd /go/src/github.com/opencontainers/runc && git checkout v1.0.0-rc8) | ||
RUN make EXTRA_LDFLAGS="-w -s" BUILDTAGS="apparmor seccomp" -C /go/src/github.com/opencontainers/runc static | ||
RUN cp /go/src/github.com/opencontainers/runc/runc /output/runc | ||
|
||
FROM scratch as artifact | ||
COPY --from=build /output/containerd /containerd | ||
COPY --from=build /output/containerd-shim /containerd-shim | ||
COPY --from=build /output/containerd-shim-runc-v1 /containerd-shim-runc-v1 | ||
COPY --from=build /output/runc /runc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/weaveworks/ignite/pkg/containerd" | ||
"k8s.io/klog" | ||
) | ||
|
||
func main() { | ||
klog.InitFlags(nil) | ||
containerd.Main() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package containerd | ||
|
||
// register containerd builtins here | ||
import ( | ||
_ "github.com/containerd/containerd/diff/walking/plugin" | ||
_ "github.com/containerd/containerd/gc/scheduler" | ||
_ "github.com/containerd/containerd/runtime/restart/monitor" | ||
_ "github.com/containerd/containerd/services/containers" | ||
_ "github.com/containerd/containerd/services/content" | ||
_ "github.com/containerd/containerd/services/diff" | ||
_ "github.com/containerd/containerd/services/events" | ||
_ "github.com/containerd/containerd/services/healthcheck" | ||
_ "github.com/containerd/containerd/services/images" | ||
_ "github.com/containerd/containerd/services/introspection" | ||
_ "github.com/containerd/containerd/services/leases" | ||
_ "github.com/containerd/containerd/services/namespaces" | ||
_ "github.com/containerd/containerd/services/opt" | ||
_ "github.com/containerd/containerd/services/snapshots" | ||
_ "github.com/containerd/containerd/services/tasks" | ||
_ "github.com/containerd/containerd/services/version" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package containerd | ||
|
||
import ( | ||
_ "github.com/containerd/containerd/metrics/cgroups" | ||
_ "github.com/containerd/containerd/runtime/v1/linux" | ||
_ "github.com/containerd/containerd/runtime/v2" | ||
_ "github.com/containerd/containerd/runtime/v2/runc/options" | ||
_ "github.com/containerd/containerd/snapshots/native" | ||
_ "github.com/containerd/containerd/snapshots/overlay" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package containerd | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/containerd/containerd/cmd/containerd/command" | ||
"github.com/containerd/containerd/pkg/seed" | ||
) | ||
|
||
func Main() { | ||
seed.WithTimeAndRand() | ||
app := command.App() | ||
if err := app.Run(os.Args); err != nil { | ||
fmt.Fprintf(os.Stderr, "containerd: %s\n", err) | ||
os.Exit(1) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.