Skip to content

Commit 9323116

Browse files
Fix ttys, fix device mounting issue in getty, add nerdctl (#222)
## Description <!--- Please describe what this PR is going to change --> For some reason I was seeing issues with the 6.6 kernel and ttys when they are not explicitly set in the linuxkit yaml. Also with the 6.6 kernel, I was seeing issues with the ctr command and character encoding or something similar. I was getting a lot of weird character when using it. Moving to nerdctl resolves this issue. Nerdctl is also a lot more user friendly in general. Also, the getty container was getting permission denied issues when trying to mount devices. Explicitly adding a block devices to the linuxkit yaml resolved this. ## Why is this needed <!--- Link to issue you have raised --> Fixes: # ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## How are existing users impacted? What migration steps/scripts do we need? <!--- Fixes a bug, unblocks installation, removes a component of the stack etc --> <!--- Requires a DB migration script, etc. --> ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
2 parents ec7b28f + a96f105 commit 9323116

File tree

3 files changed

+346
-11
lines changed

3 files changed

+346
-11
lines changed

images/containerd/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
FROM linuxkit/alpine:146f540f25cd92ec8ff0c5b0c98342a9a95e479e as builder
22

3+
ARG TARGETPLATFORM
34

45
# checkout and compile containerd
56
# Update `FROM` in `pkg/containerd/Dockerfile`, `pkg/init/Dockerfile` and
67
# `test/pkg/containerd/Dockerfile` when changing this.
78
ENV CONTAINERD_REPO=https://github.com/containerd/containerd.git
89

910
ENV CONTAINERD_COMMIT=v1.7.15
11+
ENV NERDCTL_VERSION=1.7.6
1012
ENV GOPATH=/go
1113
RUN apk add go git
1214
RUN mkdir -p $GOPATH/src/github.com/containerd && \
@@ -18,14 +20,22 @@ RUN apk add --no-cache btrfs-progs-dev gcc libc-dev linux-headers make libseccom
1820
WORKDIR $GOPATH/src/github.com/containerd/containerd
1921
RUN make binaries EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"' BUILDTAGS="static_build no_devmapper"
2022

23+
# install nerdctl
24+
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi \
25+
&& wget https://github.com/containerd/nerdctl/releases/download/v${NERDCTL_VERSION}/nerdctl-${NERDCTL_VERSION}-linux-${ARCHITECTURE}.tar.gz \
26+
&& tar -zxvf nerdctl-${NERDCTL_VERSION}-linux-${ARCHITECTURE}.tar.gz -C /usr/local/bin/
27+
2128
RUN cp bin/containerd bin/ctr bin/containerd-shim bin/containerd-shim-runc-v2 /usr/bin/
2229
RUN strip /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim-runc-v2
30+
RUN mkdir -p /opt/containerd
2331

2432
FROM scratch as containerd-dev
2533
ENTRYPOINT []
2634
WORKDIR /
2735
COPY --from=builder /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim-runc-v2 /usr/bin/
2836
COPY --from=builder /go/src/github.com/containerd/containerd /go/src/github.com/containerd/containerd
37+
COPY --from=builder /usr/local/bin/nerdctl /usr/bin/
38+
COPY --from=builder /opt/containerd/ /opt/containerd/
2939

3040
# Dockerfile to build linuxkit/containerd for linuxkit
3141
FROM linuxkit/alpine:146f540f25cd92ec8ff0c5b0c98342a9a95e479e as alpine
@@ -39,6 +49,8 @@ FROM scratch
3949
ENTRYPOINT []
4050
WORKDIR /
4151
COPY --from=containerd-dev /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim-runc-v2 /usr/bin/
52+
COPY --from=containerd-dev /usr/bin/nerdctl /usr/bin/
53+
COPY --from=containerd-dev /opt/containerd/ /opt/containerd/
4254
COPY --from=alpine /usr/share/zoneinfo/UTC /etc/localtime
4355
COPY --from=alpine /etc/init.d/ /etc/init.d/
4456
COPY etc etc/
Lines changed: 287 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,295 @@
1-
state = "/run/containerd"
1+
# default containerd configuration file, generated via `containerd config default`
2+
disabled_plugins = []
3+
imports = []
4+
oom_score = 0
5+
plugin_dir = ""
6+
required_plugins = []
27
root = "/var/lib/containerd"
3-
disabled_plugins = ["cri"]
8+
state = "/run/containerd"
9+
temp = ""
10+
version = 2
11+
12+
[cgroup]
13+
path = ""
14+
15+
[debug]
16+
address = ""
17+
format = ""
18+
gid = 0
19+
level = ""
20+
uid = 0
421

522
[grpc]
623
address = "/run/containerd/containerd.sock"
7-
uid = 0
824
gid = 0
9-
10-
[debug]
11-
address = "/run/containerd/debug.sock"
12-
level = "info"
25+
max_recv_message_size = 16777216
26+
max_send_message_size = 16777216
27+
tcp_address = ""
28+
tcp_tls_ca = ""
29+
tcp_tls_cert = ""
30+
tcp_tls_key = ""
31+
uid = 0
1332

1433
[metrics]
1534
address = ""
35+
grpc_histogram = false
36+
37+
[plugins]
38+
39+
[plugins."io.containerd.gc.v1.scheduler"]
40+
deletion_threshold = 0
41+
mutation_threshold = 100
42+
pause_threshold = 0.02
43+
schedule_delay = "0s"
44+
startup_delay = "100ms"
45+
46+
[plugins."io.containerd.grpc.v1.cri"]
47+
cdi_spec_dirs = ["/etc/cdi", "/var/run/cdi"]
48+
device_ownership_from_security_context = false
49+
disable_apparmor = false
50+
disable_cgroup = false
51+
disable_hugetlb_controller = true
52+
disable_proc_mount = false
53+
disable_tcp_service = true
54+
drain_exec_sync_io_timeout = "0s"
55+
enable_cdi = false
56+
enable_selinux = false
57+
enable_tls_streaming = false
58+
enable_unprivileged_icmp = false
59+
enable_unprivileged_ports = false
60+
ignore_image_defined_volumes = false
61+
image_pull_progress_timeout = "5m0s"
62+
max_concurrent_downloads = 3
63+
max_container_log_line_size = 16384
64+
netns_mounts_under_state_dir = false
65+
restrict_oom_score_adj = false
66+
sandbox_image = "registry.k8s.io/pause:3.8"
67+
selinux_category_range = 1024
68+
stats_collect_period = 10
69+
stream_idle_timeout = "4h0m0s"
70+
stream_server_address = "127.0.0.1"
71+
stream_server_port = "0"
72+
systemd_cgroup = false
73+
tolerate_missing_hugetlb_controller = true
74+
unset_seccomp_profile = ""
75+
76+
[plugins."io.containerd.grpc.v1.cri".cni]
77+
bin_dir = "/opt/cni/bin"
78+
conf_dir = "/etc/cni/net.d"
79+
conf_template = ""
80+
ip_pref = ""
81+
max_conf_num = 1
82+
setup_serially = false
83+
84+
[plugins."io.containerd.grpc.v1.cri".containerd]
85+
default_runtime_name = "runc"
86+
disable_snapshot_annotations = true
87+
discard_unpacked_layers = false
88+
ignore_blockio_not_enabled_errors = false
89+
ignore_rdt_not_enabled_errors = false
90+
no_pivot = false
91+
snapshotter = "overlayfs"
92+
93+
[plugins."io.containerd.grpc.v1.cri".containerd.default_runtime]
94+
base_runtime_spec = ""
95+
cni_conf_dir = ""
96+
cni_max_conf_num = 0
97+
container_annotations = []
98+
pod_annotations = []
99+
privileged_without_host_devices = false
100+
privileged_without_host_devices_all_devices_allowed = false
101+
runtime_engine = ""
102+
runtime_path = ""
103+
runtime_root = ""
104+
runtime_type = ""
105+
sandbox_mode = ""
106+
snapshotter = ""
107+
108+
[plugins."io.containerd.grpc.v1.cri".containerd.default_runtime.options]
109+
110+
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
111+
112+
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
113+
base_runtime_spec = ""
114+
cni_conf_dir = ""
115+
cni_max_conf_num = 0
116+
container_annotations = []
117+
pod_annotations = []
118+
privileged_without_host_devices = false
119+
privileged_without_host_devices_all_devices_allowed = false
120+
runtime_engine = ""
121+
runtime_path = ""
122+
runtime_root = ""
123+
runtime_type = "io.containerd.runc.v2"
124+
sandbox_mode = "podsandbox"
125+
snapshotter = ""
126+
127+
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
128+
BinaryName = ""
129+
CriuImagePath = ""
130+
CriuPath = ""
131+
CriuWorkPath = ""
132+
IoGid = 0
133+
IoUid = 0
134+
NoNewKeyring = false
135+
NoPivotRoot = false
136+
Root = ""
137+
ShimCgroup = ""
138+
SystemdCgroup = false
139+
140+
[plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime]
141+
base_runtime_spec = ""
142+
cni_conf_dir = ""
143+
cni_max_conf_num = 0
144+
container_annotations = []
145+
pod_annotations = []
146+
privileged_without_host_devices = false
147+
privileged_without_host_devices_all_devices_allowed = false
148+
runtime_engine = ""
149+
runtime_path = ""
150+
runtime_root = ""
151+
runtime_type = ""
152+
sandbox_mode = ""
153+
snapshotter = ""
154+
155+
[plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime.options]
156+
157+
[plugins."io.containerd.grpc.v1.cri".image_decryption]
158+
key_model = "node"
159+
160+
[plugins."io.containerd.grpc.v1.cri".registry]
161+
config_path = ""
162+
163+
[plugins."io.containerd.grpc.v1.cri".registry.auths]
164+
165+
[plugins."io.containerd.grpc.v1.cri".registry.configs]
166+
167+
[plugins."io.containerd.grpc.v1.cri".registry.headers]
168+
169+
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
170+
171+
[plugins."io.containerd.grpc.v1.cri".x509_key_pair_streaming]
172+
tls_cert_file = ""
173+
tls_key_file = ""
174+
175+
[plugins."io.containerd.internal.v1.opt"]
176+
path = "/opt/containerd"
177+
178+
[plugins."io.containerd.internal.v1.restart"]
179+
interval = "10s"
180+
181+
[plugins."io.containerd.internal.v1.tracing"]
182+
sampling_ratio = 1.0
183+
service_name = "containerd"
184+
185+
[plugins."io.containerd.metadata.v1.bolt"]
186+
content_sharing_policy = "shared"
187+
188+
[plugins."io.containerd.monitor.v1.cgroups"]
189+
no_prometheus = false
190+
191+
[plugins."io.containerd.nri.v1.nri"]
192+
disable = true
193+
disable_connections = false
194+
plugin_config_path = "/etc/nri/conf.d"
195+
plugin_path = "/opt/nri/plugins"
196+
plugin_registration_timeout = "5s"
197+
plugin_request_timeout = "2s"
198+
socket_path = "/var/run/nri/nri.sock"
199+
200+
[plugins."io.containerd.runtime.v1.linux"]
201+
no_shim = false
202+
runtime = "runc"
203+
runtime_root = ""
204+
shim = "containerd-shim"
205+
shim_debug = false
206+
207+
[plugins."io.containerd.runtime.v2.task"]
208+
platforms = ["linux/amd64"]
209+
sched_core = false
210+
211+
[plugins."io.containerd.service.v1.diff-service"]
212+
default = ["walking"]
213+
214+
[plugins."io.containerd.service.v1.tasks-service"]
215+
blockio_config_file = ""
216+
rdt_config_file = ""
217+
218+
[plugins."io.containerd.snapshotter.v1.aufs"]
219+
root_path = ""
220+
221+
[plugins."io.containerd.snapshotter.v1.blockfile"]
222+
fs_type = ""
223+
mount_options = []
224+
root_path = ""
225+
scratch_file = ""
226+
227+
[plugins."io.containerd.snapshotter.v1.btrfs"]
228+
root_path = ""
229+
230+
[plugins."io.containerd.snapshotter.v1.devmapper"]
231+
async_remove = false
232+
base_image_size = ""
233+
discard_blocks = false
234+
fs_options = ""
235+
fs_type = ""
236+
pool_name = ""
237+
root_path = ""
238+
239+
[plugins."io.containerd.snapshotter.v1.native"]
240+
root_path = ""
241+
242+
[plugins."io.containerd.snapshotter.v1.overlayfs"]
243+
mount_options = []
244+
root_path = ""
245+
sync_remove = false
246+
upperdir_label = false
247+
248+
[plugins."io.containerd.snapshotter.v1.zfs"]
249+
root_path = ""
250+
251+
[plugins."io.containerd.tracing.processor.v1.otlp"]
252+
endpoint = ""
253+
insecure = false
254+
protocol = ""
255+
256+
[plugins."io.containerd.transfer.v1.local"]
257+
config_path = ""
258+
max_concurrent_downloads = 3
259+
max_concurrent_uploaded_layers = 3
260+
261+
[[plugins."io.containerd.transfer.v1.local".unpack_config]]
262+
differ = ""
263+
platform = "linux/amd64"
264+
snapshotter = "overlayfs"
265+
266+
[proxy_plugins]
267+
268+
[stream_processors]
269+
270+
[stream_processors."io.containerd.ocicrypt.decoder.v1.tar"]
271+
accepts = ["application/vnd.oci.image.layer.v1.tar+encrypted"]
272+
args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
273+
env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
274+
path = "ctd-decoder"
275+
returns = "application/vnd.oci.image.layer.v1.tar"
276+
277+
[stream_processors."io.containerd.ocicrypt.decoder.v1.tar.gzip"]
278+
accepts = ["application/vnd.oci.image.layer.v1.tar+gzip+encrypted"]
279+
args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
280+
env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
281+
path = "ctd-decoder"
282+
returns = "application/vnd.oci.image.layer.v1.tar+gzip"
283+
284+
[timeouts]
285+
"io.containerd.timeout.bolt.open" = "0s"
286+
"io.containerd.timeout.metrics.shimstats" = "2s"
287+
"io.containerd.timeout.shim.cleanup" = "5s"
288+
"io.containerd.timeout.shim.load" = "5s"
289+
"io.containerd.timeout.shim.shutdown" = "3s"
290+
"io.containerd.timeout.task.state" = "2s"
291+
292+
[ttrpc]
293+
address = ""
294+
gid = 0
295+
uid = 0

0 commit comments

Comments
 (0)