Windows Server 2016 – Docker memory and cpu parameters

Screenshot 20181127 081234

The following docker parameters help you specify how much memory and cpu cycles the container is permitted to use. -c cpu shares, a value from 0 to 1024 (relative weight –cpuset-cpus=”” Allow execution in CPUs (0-3, 0, 1) –cpuset-mems=”” Memory nodes in which to allow execution. Only on NUMA systems (0-3, 0, 1) –cpu-quota=0 Limit the CPU CFS quota -m Memory limit. Integer number and the unit can be b, k, m or g –memory-swap=”” Total memory, memory and swap. –memory-reservation=”” Memory soft limit – the host retains this memory for the container More information on runtime constraints on…

Windows Server 2016 – Docker memory and cpu parameters Read More

Windows Server 2016 – Docker create and remove data volume

Screenshot 20181126 081226

You can create a volume for a container if you want the data to be available across containers. Even if you delete the container, the data volume will remain on the container host. Create a new volume volume create my-vol Find information about the volume you created docker volume inspect my-vol Then run the container docker run -d –name test –mount source=my-vol,target=c:\data microsoft/nanoserver the directory data in the container must exist. check the information for the container. Look for the mounts section. docker inspect test   If you want to…

Windows Server 2016 – Docker create and remove data volume Read More

Windows Server 2016 – Docker manage network

Screenshot 20181125 083334

Display a list of all the container networks docker network ls Create a transparent network, instead of using NAT docker network create -d transparent trans More information about docker network create here. Run a container with the transparent network docker run -it –network=trans microsoft/nanoserver powershell To use port-mapping add the -p docker run -it -p 8080:80 microsoft/nanoserver powershell # Map TCP port 80 in the container to port 8080 on the Docker host. More information about docker and networking here.   Windows Server 2016 – Docker manage network

Windows Server 2016 – Docker manage network Read More

Windows Server 2016 – Manage Docker with PowerShell cmdlets

Screenshot 20181124 081451 1

If you haven’t configured PowerShell with docker cmdlets, then read this post. List Containers get-container   Start and Stop container start-container containerID stop-container containerID   Attach to Container enter-containerSession containerID   Remove Container remove-container containerID   Windows Server 2016 – Manage Docker with PowerShell cmdlets

Windows Server 2016 – Manage Docker with PowerShell cmdlets Read More