De Wiki inetshell
Saltar a: navegación, buscar

Entorno grafico

https://github.com/jlesage/docker-firefox

https://github.com/fcwu/docker-ubuntu-vnc-desktop

Bases

https://www.digitalocean.com/community/tutorials/webinar-series-getting-started-with-containers

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-centos-7

Mailserver

https://poste.io/demo

https://tvi.al/simple-mail-server-with-docker/

Webserver

https://www.digitalocean.com/community/tutorials/how-to-secure-your-rancher-web-app-with-let-s-encrypt-on-ubuntu-16-04

https://medium.com/@francoisromain/host-multiple-websites-with-https-inside-docker-containers-on-a-single-server-18467484ab95

https://blog.ssdnodes.com/blog/tutorial-using-docker-and-nginx-to-host-multiple-websites/

Seguridad

https://security.stackexchange.com/questions/152978/is-it-possible-to-escalate-privileges-and-escaping-from-a-docker-container

https://raesene.github.io/blog/2016/03/06/The-Dangers-Of-Docker.sock/

https://www.nccgroup.trust/uk/our-research/abusing-privileged-and-unprivileged-linux-containers/

https://www.nccgroup.trust/uk/our-research/understanding-and-hardening-linux-containers/

Almacenamiento persistente

https://server-world.info/en/note?os=CentOS_7&p=docker&f=8

https://www.youtube.com/watch?v=uQigvjSXMLw

https://github.com/cr0hn/dockerscan

https://www.oreilly.com/ideas/five-security-concerns-when-using-docker

https://umbrella.cisco.com/blog/2016/03/17/considering-docker-consider-security-first/

https://www.twistlock.com/2017/12/27/escaping-docker-container-using-waitid-cve-2017-5123/

https://sysdig.com/blog/7-docker-security-vulnerabilities/


Windows

Varios

https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/swarm-mode

https://docs.docker.com/v17.12/install/windows/docker-ee/#install-a-specific-version


https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon

Instalar en Windows 2016

https://docs.docker.com/install/windows/docker-ee/#install-docker-ee

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module DockerMsftProvider -Force
Install-Package Docker -ProviderName DockerMsftProvider -Force

https://blog.docker.com/2016/09/dockerforws2016/

https://blog.alexellis.io/run-iis-asp-net-on-windows-10-with-docker/

Cambiar ubicacion de almacenamiento

https://social.technet.microsoft.com/Forums/Azure/en-US/4ac564e2-ad6d-4d32-8cb4-7fea481738a4/how-to-change-docker-images-and-containers-location-with-windows-containers?forum=ws2016

  • Crear el archivo C:\ProgramData\docker\config\daemon.json
{"graph": "D:\\Docker"}

ASP.NET + Oracle Client

http://www.codesin.net/post/Oracle_ODAC/

IIS

https://github.com/Microsoft/aspnet-docker/issues/5

https://github.com/dotnet-architecture/eShopModernizing/wiki/02.-How-to-containerize-the-.NET-Framework-web-apps-with-Windows-Containers-and-Docker

Rancher v1.6 en Windows

https://github.com/rancher/rancher/wiki/Creating-Windows-Environments-in--v1.6.13

Comandos Docker

Acoplar y desacoplar sesión Docker

  • Desacoplar:
 Ctrl + p + q 
  • Acoplar:
docker attach -name docker_test

Correr sin root

https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user

Como root:

USER=rke
groupadd docker
usermod -aG docker $USER
systemctl restart docker
docker run hello-world

Compilar imagen

docker build --squash --rm=true -t docker_image:0.5.3 .
docker run -ti --rm --env-file=env_file docker_image:0.5.3

Compilar imagen con argumentos

https://vsupalov.com/docker-arg-env-variable-guide/

Subir imagen a DockerHub

https://ropenscilabs.github.io/r-docker-tutorial/04-Dockerhub.html

Visualizar uso de recursos

https://docs.docker.com/engine/reference/commandline/stats/#formatting

docker stats --format "{{.Name}}: {{.CPUPerc}} - {{.MemUsage}}"

Subir imagen a registry

https://blog.sonatype.com/using-nexus-3-as-your-repository-part-3-docker-images

  • vi /etc/docker/daemon.json:
{
  "insecure-registries": [
    "your-repo:8082",
    "your-repo:8083"
  ],
  "disable-legacy-registry": true
}
  • Upload image:
docker login nexus:8080
docker tag df0d67d9f438 nexus:8080/dockerimage/16
docker push nexus:8080/dockerimage/16

Docker en CentOS 7

Montar volumen con SELinux activo

https://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/

docker run -v /var/db:/var/db:z rhel7 /bin/sh

Docker Compose

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-centos-7

sudo yum install epel-release
sudo yum install -y python-pip
sudo pip install docker-compose
sudo yum upgrade python*

Reparar PIP y Docker Compose

https://github.com/docker/compose/issues/4401

pip uninstall docker
pip uninstall docker-py
pip uninstall docker-compose
pip install docker-compose==1.9.0

RancherOS

http://weblogs.com.pk/khurram/archive/2016/07/23/rancheros.aspx

Install

  • Boot ISO
  • Get host IP:
ip address
  • Set rancher user password:
sudo passwd rancher
  • Create cloud-config.yml:
#cloud-config
ssh_authorized_keys:
  - ssh-ed25519 .....
hostname: rancher01
  • Run command:
sudo ros install -c cloud-config.yml -d /dev/vda
  • Reboot server
  • Enter via SSH to server
  • Add rancher server:
sudo docker run --name=rancher-host01 --restart=always -p 8080:8080 -d rancher/server:stable

Manejo de variables

https://vsupalov.com/docker-arg-env-variable-guide/

Eliminar contenedores manualmente

https://coderwall.com/p/-vsmba/manually-remove-docker-containers-on-ubuntu

service docker stop
rm -rf /var/lib/docker/containers/*
rm -rf /var/lib/docker/vfs/dir/*
service docker start

Respaldar volumenes

https://docs.docker.com/storage/volumes/#backup-restore-or-migrate-data-volumes

docker run --rm --volumes-from dbstore -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata

Usar Proxy

https://docs.docker.com/network/proxy/

  • Editar "~/.docker/config.json"
{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://127.0.0.1:3001",
     "noProxy": "*.test.example.com,.example2.com"
   }
 }
}

Controlar docker desde otro contenedor

https://forums.docker.com/t/how-can-i-run-docker-command-inside-a-docker-container/337/2

docker run -it -v /var/run/docker.sock:/var/run/docker.sock ubuntu:latest sh -c "apt-get update ; apt-get install docker.io -y ; bash"