18

I am making a docker containerized application using visual studio 2017. When running docker through visual studio first, I got an error that "ERROR: client version 1.22 is too old".

This error was resolved by updating docker compose to version 2.1

Below link contains further instruction about this specific error

ERROR: client version 1.22 is too old

After this error was resolved ,On Building docker now I get "HNS failed with error : The parameter is incorrect."

From multiple github discussion I have found that it is a windows network error.

Is there a solution to this problem ? Should I down grade docker version or install something else.

I am using windows container. On running docker version Client: Version: 17.06.0-ce API version: 1.30 Go version: go1.8.3 Git commit: 02c1d87 Built: Fri Jun 23 21:30:30 2017 OS/Arch: windows/amd64

Server: Version: 17.06.0-ce API version: 1.30 (minimum version 1.24) Go version: go1.8.3 Git commit: 02c1d87 Built: Fri Jun 23 22:19:00 2017 OS/Arch: windows/amd64 Experimental: true

Edit:

If I switch to linux container this problem is solved. But another issue occurs drive is not shared. After sharing d: drive drive sharing issue still occurs.

How can I resolve linux container drive sharing issue.

I want to use windows container locally so that I can deploy this app on azure.

Khalil
  • 1,047
  • 4
  • 17
  • 34
  • Try to clean your docker network stack (https://github.com/Microsoft/Virtualization-Documentation/tree/master/windows-server-container-tools/CleanupContainerHostNetworking) – Gregory Suvalian Jul 29 '17 at 21:56

3 Answers3

35

This is a known limitation. At present windows only supports one NAT network. Removing Netnat by invoke Remove-Netnat is not supported.

Run this in powerhell.

Get-NetNat | Remove-NetNat

Khalil
  • 1,047
  • 4
  • 17
  • 34
  • Hello, I'm using these comands and run docker-compose up -d nginx and return error: ERROR: Network "laradock_default" needs to be recreated - option "com.docker.network.windowsshim.hnsid" has changed – Junior Mcq Sep 28 '17 at 14:16
  • Search laradock github repository for similar issues. You might find an answer. – Khalil Sep 30 '17 at 07:21
  • 1
    Just in case if anyone needs to follow up on this issue https://github.com/docker/for-win/issues/598 – Sibeesh Venu Jun 12 '18 at 09:02
6

To prevent docker-compose from creating a new default network you can use the existing one by specifying it in docker-compose.yml:

networks:
    default:
        external:
            name: nat

To check for existing networks execute

docker network ls
Daniel K
  • 61
  • 1
  • 2
0

Open the powershell(X64) in admin mode Execute below command

Get-NetNat 

If it returns something like this

enter image description here

Then run below command in powershell

Remove-NetNat
Rajan Domala
  • 133
  • 1
  • 8