mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 20:50:24 +00:00
Add a pause image for the net container.
The pause image is a 240KB image that simply pauses waiting on a signal. Use this for the net container which only needs to act as a placeholder. Current net image is ~2.5MB. From my tests, this reduces startup time for the net container from ~14s to ~6s.
This commit is contained in:
3
build/pause/Dockerfile
Normal file
3
build/pause/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM scratch
|
||||
ADD pause /
|
||||
ENTRYPOINT ["/pause"]
|
8
build/pause/pause.go
Normal file
8
build/pause/pause.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
import "syscall"
|
||||
|
||||
func main() {
|
||||
// Halts execution, waiting on signal.
|
||||
syscall.Pause()
|
||||
}
|
6
build/pause/prepare.sh
Executable file
6
build/pause/prepare.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
go build --ldflags '-extldflags "-static" -s' pause.go
|
Reference in New Issue
Block a user