arthurd2

Estacio - Docker

May 21st, 2018
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.35 KB | None | 0 0
  1. #################### Atividade 1 #############################
  2. apt install software-properties-common curl
  3. apt remove docker.io
  4.  
  5. sudo curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose
  6. chmod a+x /usr/bin/docker-compose
  7.  
  8. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  9. sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  10. sudo apt update
  11.  
  12. sudo apt-get install docker-ce
  13. sudo docker swarm init
  14.  
  15. ##################### Atividade 2 ##############################
  16. sysctl -w net.ipv6.conf.default.disable_ipv6=1
  17. docker volume create portainer_data
  18. docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
  19. reboot
  20.  
  21. ##################### Atividade 3 ##############################
  22. FROM ubuntu
  23. LABEL MAINTAINER Guilherme Geronimo
  24. LABEL MAIL <guilherme.geronimo@gmail.com>
  25. RUN apt-get update && apt-get install -y nginx && apt-get clean
  26. EXPOSE 80
  27. CMD ["nginx", "-g", "daemon off;"]
  28.  
  29. ##################### Atividade 4 ##############################
  30. version: "3.1"
  31. services:
  32.   s1web:
  33.     image: web
  34.     deploy:
  35.       replicas: 2
  36.     ports:
  37.       - 82:80
  38.   s2web:
  39.     image: web
  40.     ports:
  41.       - 83:80
Advertisement
Add Comment
Please, Sign In to add comment