constructor-igor / TechSugar

Tech. Sugar seminars
7 stars 7 forks source link

Docker on Windows 10 and Server 2016 #443

Open constructor-igor opened 5 years ago

constructor-igor commented 5 years ago

courses:

https://habr.com/ru/post/310460/ https://habr.com/ru/post/358774/

https://docs.docker.com/docker-for-windows/install/

Pre-requirements:

constructor-igor commented 5 years ago

image

constructor-igor commented 5 years ago

commands:

constructor-igor commented 5 years ago

command docker run ubuntu

image

after switch to Linux containers: image

docker run -it ubuntu bash

image

image

constructor-igor commented 5 years ago

kitematic issue:

image

constructor-igor commented 5 years ago

sample: MySql + Wordpress docker run --name easql -e MYSQL_ROOT_PASSWORD=abc123 -d mysql:latest (see details in https://hub.docker.com/_/mysql)

docker run --name some-wordpress --link some-mysql:mysql -d wordpress docker run --name ealocal --link easql:mysql -p:8080:80 -d wordpress docker run --name ealocal --link easql -p 8080:80 -e WORDPRESS_DB_HOST=mysql:3306 -e WORDPRESS_DB_USER=root -e WORDPRESS_DB_PASSWORD=Password1234 -e WORDPRESS_DB_NAME=wordpress -e WORDPRESS_TABLE_PREFIX=wp_ -d wordpress https://hub.docker.com/_/wordpress

http://localhost:8080/wp-admin/install.php image

https://wordpress.org/support/forums/ http://www.ntweekly.com/2019/09/20/running-wordpress-and-mysql-on-docker-containers/

version: '2'
services:
    wordpress:
        image: wordpress
        ports:
            - "8080:80"
        environment:
            WORDPRESS_DB_PASSWORD: abc123
    mysql:
        image: mysql:latest
        environment:
            MYSQL_ROOT_PASSWORD: abc123
constructor-igor commented 5 years ago

docker pull selenium/hub docker pull selenium/node-chrome-debug

docker run -d --name selenium-hub selenium/hub docker run -d -p 4446:4444 --name selenium-hub -P selenium/hub docker run -d -P --link selenium-hub:hub selenium/node-chrome-debug

constructor-igor commented 5 years ago

nanoserver on windows 2019: docker pull mcr.microsoft.com/windows/nanoserver:1809 docker run -it mcr.microsoft.com/windows/nanoserver:1809 cmd

constructor-igor commented 5 years ago

simple sample to build windows + .net docker: https://github.com/microsoft/dotnet-framework-docker-samples/tree/master/dotnetapp-4.7

updated: docker file:

FROM microsoft/dotnet-framework
WORKDIR /app
COPY bin/Release/net48 .
ENTRYPOINT ["dotnetapp-4.8.exe"]

to build docket container: docker build . -t dotnet48-app to run the container: docker run dotnet48-app

constructor-igor commented 5 years ago

How to properly override the ENTRYPOINT using docker run

docker run -it --entrypoint "cmd" my_docker_container_image_name
constructor-igor commented 5 years ago

https://blog.sixeyed.com/docker-volumes-on-windows-the-case-of-the-g-drive/ How to amount disk:

docker run -it --entrypoint "cmd" -v C:\Projects\docker\MPlugin\mydata:c:\mydisk my_docker_container_image_name