k3s/scripts/dev-docker-agent.sh

25 lines
756 B
Bash
Raw Normal View History

2019-01-09 16:54:15 +00:00
#!/bin/bash
2019-03-07 16:32:33 +00:00
set -e
2019-01-09 16:54:15 +00:00
cd $(dirname $0)/..
2019-03-07 16:32:33 +00:00
. ./scripts/setup-rancher-path.sh
2019-01-09 16:54:15 +00:00
IP=$(ip addr show dev docker0 | grep -w inet | awk '{print $2}' | cut -f1 -d/)
docker run \
--read-only \
--tmpfs /run \
--tmpfs /var/run \
--tmpfs /tmp \
-v /lib/modules:/lib/modules:ro \
-v /lib/firmware:/lib/firmware:ro \
-v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro \
-v $(pwd)/bin:/usr/bin \
-v /var/log \
2019-11-07 19:59:25 +00:00
-v /var/lib/kubelet \
2019-01-09 16:54:15 +00:00
-v /var/lib/rancher/k3s \
-v /var/lib/cni \
-v /usr/lib/x86_64-linux-gnu/libsqlite3.so.0:/usr/lib/x86_64-linux-gnu/libsqlite3.so.0:ro \
--privileged \
ubuntu:18.04 /usr/bin/k3s-agent agent -t $(<${RANCHER_PATH}/k3s/server/node-token) -s https://${IP}:6443