github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/pkg/filesystem/rootfs/containerd/scripts/containerd.sh (about)

     1  #!/bin/bash
     2  # Copyright © 2021 Alibaba Group Holding Ltd.
     3  #
     4  # Licensed under the Apache License, Version 2.0 (the "License");
     5  # you may not use this file except in compliance with the License.
     6  # You may obtain a copy of the License at
     7  #
     8  #     http://www.apache.org/licenses/LICENSE-2.0
     9  #
    10  # Unless required by applicable law or agreed to in writing, software
    11  # distributed under the License is distributed on an "AS IS" BASIS,
    12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  # See the License for the specific language governing permissions and
    14  # limitations under the License.
    15  
    16  set -x
    17  set -e
    18  if ! [ -x /usr/local/bin/ctr ]; then
    19    tar  -xvzf ../cri/containerd.tar.gz -C /
    20    [ -f /usr/lib64/libseccomp.so.2 ] || cp -rf ../lib64/lib* /usr/lib64/
    21    systemctl enable  containerd.service
    22    systemctl restart containerd.service
    23  fi
    24  
    25  mkdir -p /etc/containerd
    26  
    27  sed -i "s/sea.hub/${1:-sea.hub}/g" ../etc/dump-config.toml
    28  sed -i "s/5000/${2:-5000}/g" ../etc/dump-config.toml
    29  
    30  #add cri sandbox image and sea.hub registry cert path
    31  ##sandbox_image = "sea.hub:5000/pause:3.6" custom setup
    32  containerd --config ../etc/dump-config.toml config dump > /etc/containerd/config.toml
    33  
    34  systemctl restart containerd.service