Skip to content

Instantly share code, notes, and snippets.

@projectoperations
Created December 31, 2024 05:06
Show Gist options
  • Save projectoperations/6745b403ba88bf02f7d16e5ea4bd62b2 to your computer and use it in GitHub Desktop.
Save projectoperations/6745b403ba88bf02f7d16e5ea4bd62b2 to your computer and use it in GitHub Desktop.
#!/bin/bash
DIST_BASE="ubuntu"
apt update
apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/$DIST_BASE/gpg | sudo apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$DIST_BASE $(lsb_release -cs) stable"
apt install -y docker-ce docker-ce-cli containerd.io
cat << EOF > /etc/docker/daemon.json
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}
EOF
systemctl restart docker
docker run --name hello hello-world
docker inspect hello | grep max-size
docker stop hello
docker rm hello
# docker volume create portainer_data
# docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment