37 lines
1.2 KiB
Bash
Executable File
37 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright 2014 The Kubernetes Authors.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
set -e
|
|
set -o pipefail
|
|
|
|
MOUNTER_DOCKER_IMAGE=gcr.io/google_containers/gci-mounter
|
|
MOUNTER_DOCKER_VERSION=v2
|
|
MOUNTER_USER=root
|
|
RKT_BINARY=/home/kubernetes/bin/rkt
|
|
|
|
function gc {
|
|
${RKT_BINARY} gc --grace-period=0s &> /dev/null
|
|
}
|
|
|
|
# Garbage collect old rkt containers on exit
|
|
trap gc EXIT
|
|
|
|
${RKT_BINARY} run --stage1-name="coreos.com/rkt/stage1-fly:1.18.0" \
|
|
--insecure-options=image \
|
|
--volume=rootfs,kind=host,source=/,readOnly=false,recursive=true \
|
|
--mount volume=rootfs,target=/media/root \
|
|
docker://${MOUNTER_DOCKER_IMAGE}:${MOUNTER_DOCKER_VERSION} --user=${MOUNTER_USER} --exec /bin/mount -- "$@"
|