Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save f3llps/7de76e50c7349fd32b6d85aea7cbc52e to your computer and use it in GitHub Desktop.
Save f3llps/7de76e50c7349fd32b6d85aea7cbc52e to your computer and use it in GitHub Desktop.

Revisions

  1. @rafjsouza rafjsouza revised this gist Mar 17, 2022. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions configuring-docker-linux-amazon-ec2.md
    Original file line number Diff line number Diff line change
    @@ -39,9 +39,6 @@ sudo docker swarm init
    --nas outras instancias executar o comando retornado do docker swarm init


    --install Portainer
    no master
    docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:2.11.1



  2. @rafjsouza rafjsouza revised this gist Mar 16, 2022. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions configuring-docker-linux-amazon-ec2.md
    Original file line number Diff line number Diff line change
    @@ -39,6 +39,11 @@ sudo docker swarm init
    --nas outras instancias executar o comando retornado do docker swarm init


    --install Portainer
    no master
    docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:2.11.1





  3. @rafjsouza rafjsouza revised this gist Mar 16, 2022. 1 changed file with 38 additions and 38 deletions.
    76 changes: 38 additions & 38 deletions configuring-docker-linux-amazon-ec2.md
    Original file line number Diff line number Diff line change
    @@ -1,42 +1,42 @@
    ******* Amazon EC2
    --utilitarios
    sudo yum upgrade -y \
    && sudo yum upgrade -y \
    && sudo yum install \
    htop \
    mc \
    wget \
    curl \
    ca-certificates \
    -y

    --install ctop
    sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.1/ctop-0.7.1-linux-amd64 -O /usr/local/bin/ctop \
    && sudo chmod +x /usr/local/bin/ctop

    --docker
    sudo yum update -y \
    && sudo amazon-linux-extras install docker -y \
    && sudo systemctl enable docker \
    && sudo gpasswd -a ec2-user docker \
    && sudo service docker start


    --configurando regras de network
    -Criar um security group e adicionar as regras abaixo

    Inbound Rules
    ![image](https://user-images.githubusercontent.com/22361235/158500884-d20bc79c-2eb8-4a64-a47a-42b601c04e04.png)

    Outbound Rules
    ![image](https://user-images.githubusercontent.com/22361235/158500968-43365dd8-392e-4986-9101-1d6f9964603e.png)

    Adicionar as instâncias à esse security group

    --na instância master executar o comando abaixo
    sudo docker swarm init

    --nas outras instancias executar o comando retornado do docker swarm init
    --utilitarios
    sudo yum upgrade -y \
    && sudo yum upgrade -y \
    && sudo yum install \
    htop \
    mc \
    wget \
    curl \
    ca-certificates \
    -y
    --install ctop
    sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.1/ctop-0.7.1-linux-amd64 -O /usr/local/bin/ctop \
    && sudo chmod +x /usr/local/bin/ctop
    --docker
    sudo yum update -y \
    && sudo amazon-linux-extras install docker -y \
    && sudo systemctl enable docker \
    && sudo gpasswd -a ec2-user docker \
    && sudo service docker start


    --configurando regras de network
    -Criar um security group e adicionar as regras abaixo
    Inbound Rules
    ![image](https://user-images.githubusercontent.com/22361235/158500884-d20bc79c-2eb8-4a64-a47a-42b601c04e04.png)
    Outbound Rules
    ![image](https://user-images.githubusercontent.com/22361235/158500968-43365dd8-392e-4986-9101-1d6f9964603e.png)
    Adicionar as instâncias à esse security group
    --na instância master executar o comando abaixo
    sudo docker swarm init
    --nas outras instancias executar o comando retornado do docker swarm init



  4. @rafjsouza rafjsouza renamed this gist Mar 16, 2022. 1 changed file with 7 additions and 29 deletions.
    Original file line number Diff line number Diff line change
    @@ -25,40 +25,18 @@ sudo yum update -y \
    --configurando regras de network
    -Criar um security group e adicionar as regras abaixo

    Inbound
    ![image](https://user-images.githubusercontent.com/22361235/158500383-659b60fa-d4d2-49c4-a75b-33318159fb9b.png)
    Inbound Rules
    ![image](https://user-images.githubusercontent.com/22361235/158500884-d20bc79c-2eb8-4a64-a47a-42b601c04e04.png)

    Outbound
    ![image](https://user-images.githubusercontent.com/22361235/158500542-ebca88ee-f860-4fd8-9ece-d2da32f335e8.png)
    Outbound Rules
    ![image](https://user-images.githubusercontent.com/22361235/158500968-43365dd8-392e-4986-9101-1d6f9964603e.png)

    Adicionar as instâncias à esse security group

    --na instância master executar o comando abaixo
    sudo docker swarm init

    ******* Debian
    sudo apt-get update && sudo apt-get upgrade -y
    sudo apt-get update \
    && sudo apt-get upgrade -y \
    && sudo apt-get install \
    htop \
    ctop \
    mc \
    wget \
    curl \
    apt-transport-https \
    ca-certificates \
    software-properties-common \
    -y


    -----docker
    ---Adicionando chave
    curl -fsSL https://download.docker.com.linex/ubuntu/gpg | sudo apt-key add-

    --adicionando repositório
    sudo add-apt-repository "deb [arc=amd64]] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt-get update && sudo apt-get install docker-ce -y


    --nas outras instancias executar o comando retornado do docker swarm init



  5. @rafjsouza rafjsouza renamed this gist Mar 16, 2022. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions configuring-docker-linux.txt → configuring-docker-linux.md
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,18 @@ sudo yum update -y \
    && sudo service docker start


    --configurando regras de network
    -Criar um security group e adicionar as regras abaixo

    Inbound
    ![image](https://user-images.githubusercontent.com/22361235/158500383-659b60fa-d4d2-49c4-a75b-33318159fb9b.png)

    Outbound
    ![image](https://user-images.githubusercontent.com/22361235/158500542-ebca88ee-f860-4fd8-9ece-d2da32f335e8.png)

    Adicionar as instâncias à esse security group


    ******* Debian
    sudo apt-get update && sudo apt-get upgrade -y
    sudo apt-get update \
    @@ -50,3 +62,5 @@ sudo apt-get update && sudo apt-get install docker-ce -y





  6. @rafjsouza rafjsouza renamed this gist Mar 16, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. @rafjsouza rafjsouza created this gist Mar 16, 2022.
    52 changes: 52 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,52 @@
    ******* Amazon EC2
    --utilitarios
    sudo yum upgrade -y \
    && sudo yum upgrade -y \
    && sudo yum install \
    htop \
    mc \
    wget \
    curl \
    ca-certificates \
    -y

    --install ctop
    sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.1/ctop-0.7.1-linux-amd64 -O /usr/local/bin/ctop \
    && sudo chmod +x /usr/local/bin/ctop

    --docker
    sudo yum update -y \
    && sudo amazon-linux-extras install docker -y \
    && sudo systemctl enable docker \
    && sudo gpasswd -a ec2-user docker \
    && sudo service docker start


    ******* Debian
    sudo apt-get update && sudo apt-get upgrade -y
    sudo apt-get update \
    && sudo apt-get upgrade -y \
    && sudo apt-get install \
    htop \
    ctop \
    mc \
    wget \
    curl \
    apt-transport-https \
    ca-certificates \
    software-properties-common \
    -y


    -----docker
    ---Adicionando chave
    curl -fsSL https://download.docker.com.linex/ubuntu/gpg | sudo apt-key add-

    --adicionando repositório
    sudo add-apt-repository "deb [arc=amd64]] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt-get update && sudo apt-get install docker-ce -y