This commit is contained in:
Sthope 2022-08-14 11:05:03 +02:00
parent 718c25bf3c
commit 69472df977
2 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,72 @@
#!/bin/bash
# ___ _ _ _ __
# / __|| |_ | |_ ___ | '_ \ ___
# \__ \| _|| \ / _ \| .__// -_)
# |___/ \__||_||_|\___/|_| \___|
#### USAGE
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/portainer/install-portainer-agent)" EDGE_ID EDGE_KEY
EDGE_ID=1
EDGE_KEY=2
NETWORK=3
TAG=4
DOCKER_FILE="./test123.log"
SAVE_IN='echo -e '
SAVE_OUT=''
# cat > ./test_file.log <<EOF
# docker run -d \
# -v /var/run/docker.sock:/var/run/docker.sock \
# -v /var/lib/docker/volumes:/var/lib/docker/volumes \
# -v /:/host \
# -v portainer_agent_data:/data \
# --restart always \
# --network= ${NETWORK}
# -e EDGE=1 \
# -e EDGE_ID=${EDGE_ID} \
# -e EDGE_KEY=${EDGE_KEY} \
# -e EDGE_INSECURE_POLL=1 \
# --name portainer_edge_agent \
# portainer/agent:${TAG}
# EOF
# if [ -f ${DOCKER_FILE} ];
# thenSAVE_IN
# echo "File already exist"
# else
# cat >> ${DOCKER_FILE} <<EOF
# docker run -d \
# -v /var/run/docker.sock:/var/run/docker.sock \
# -v /var/lib/docker/volumes:/var/lib/docker/volumes \
# -v /:/host \
# -v portainer_agent_data:/data \
# --restart always \
# --network= ${NETWORK}
# -e EDGE=1 \
# -e EDGE_ID=${EDGE_ID} \
# -e EDGE_KEY=${EDGE_KEY} \
# -e EDGE_INSECURE_POLL=1 \
# --name portainer_edge_agent \
# portainer/agent:${TAG}
# EOF
# fi
# clear;cat <<EOF
# docker run -d \
# -v /var/run/docker.sock:/var/run/docker.sock \
# -v /var/lib/docker/volumes:/var/lib/docker/volumes \
# -v /:/host \
# -v portainer_agent_data:/data \
# --restart always \
# --network= ${NETWORK}
# -e EDGE=1 \
# -e EDGE_ID=${EDGE_ID} \
# -e EDGE_KEY=${EDGE_KEY} \
# -e EDGE_INSECURE_POLL=1 \
# --name portainer_edge_agent \
# portainer/agent:${TAG}
# EOF

View File

@ -0,0 +1,2 @@
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes -v /:/host -v portainer_agent_data:/data --restart always --network= 3
-e EDGE=1 -e EDGE_ID=1 -e EDGE_KEY=2 -e EDGE_INSECURE_POLL=1 --name portainer_edge_agent portainer/agent:4