Skip to content

Instantly share code, notes, and snippets.

@danielbene
Last active August 29, 2024 05:16
Show Gist options
  • Select an option

  • Save danielbene/98d7a5b08fd5c2c18d4883f250e4b6c6 to your computer and use it in GitHub Desktop.

Select an option

Save danielbene/98d7a5b08fd5c2c18d4883f250e4b6c6 to your computer and use it in GitHub Desktop.

Revisions

  1. danielbene revised this gist Nov 18, 2023. No changes.
  2. danielbene revised this gist Nov 18, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker_install.sh
    Original file line number Diff line number Diff line change
    @@ -29,4 +29,4 @@ 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
    # 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
  3. danielbene revised this gist Nov 18, 2023. 1 changed file with 21 additions and 7 deletions.
    28 changes: 21 additions & 7 deletions docker_install.sh
    Original file line number Diff line number Diff line change
    @@ -2,17 +2,31 @@

    DIST_BASE="ubuntu"

    apt-get update
    apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    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-get install -y docker-ce docker-ce-cli containerd.io
    apt install -y docker-ce docker-ce-cli containerd.io

    docker run hello-world
    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
    cat << EOF > /etc/docker/daemon.json
    {
    "log-driver": "json-file",
    "log-opts": {
    "max-size": "10m",
    "max-file": "3"
    }
    }
    EOF

    apt-get install -y docker-compose
    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
  4. danielbene revised this gist Dec 4, 2020. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions docker_install.sh
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,18 @@
    #!/bin/bash

    DIST_BASE="debian"
    DIST_BASE="ubuntu"

    apt-get update
    apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    apt-get 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-get install docker-ce docker-ce-cli containerd.io
    apt-get install -y docker-ce docker-ce-cli containerd.io

    docker run hello-world
    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

    apt-get install docker-compose
    apt-get install -y docker-compose
  5. danielbene created this gist Jan 5, 2020.
    16 changes: 16 additions & 0 deletions docker_install.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/bin/bash

    DIST_BASE="debian"

    apt-get update
    apt-get install 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-get install docker-ce docker-ce-cli containerd.io

    docker run hello-world

    apt-get install docker-compose