Enterprise servers are not always exposed to the internet and are often sitting behind firewalls with restrictions to prohibit any malicious activity on an internet-facing server. But to install a Docker image from the Docker Hub, you need internet access. To overcome this, you can configure a Docker client to use a proxy server if one is available, but there is another way around this, which we will discuss in the following high-level steps.

Prateek Singh

Prateek Singh is an infrastructure developer, an avid PowerShell blogger, and a community contributor. In 2017, FeedSpot recognized his blog RidiCurious.com as among the "Top 50 PowerShell blogs in the world." All of his PowerShell projects and modules are open-sourced at GitHub, and you can reach out to him on Twitter at @SinghPrateik.

Latest posts by Prateek Singh (see all)

Install Docker with internet access ^

Log in to a Windows 10 machine that has internet access, probably your laptop or workstation, and use the following URL for instructions to install Docker on Windows 10.

Once the installation is complete, run a PowerShell console and verify the Docker installation on Windows 10:

Verify the Docker installation

Verify the Docker installation

Pull the image from the Docker Hub and export it ^

Now use Docker to download or pull a Docker test image from the Docker Hub. We'll later use this image to test a Docker installation on Windows Server 2016.

After downloading the image, use the docker save command to export and save the image to a file ("nano.tar" for example).

This will save the image as "nano.tar" in your current working directory.

Download Docker Enterprise ^

Now that we have a Docker image, let's use PowerShell to download "Docker Enterprise Edition" to our local workstation as a zip file. We will need this because we don't have internet access on Windows Server 2016.

$URL = 'https://download.docker.com/components/engine/windows-server/17.06/docker-17.06.2-ee-16.zip'

We can now copy the two files: Docker Enterprise Edition for Windows Server 2016 as a zipped file and a test Docker image we have saved as "nano.tar" in the previous step to the target Windows 2012 Server.

Install Docker Enterprise on Windows Server 2016 ^

Let's switch to the Windows 2012 Server and assume you have placed the Docker Enterprise installation files and the image on D:\. So the first step required is installing the container feature on the Windows 2012 Server and then rebooting the machine when prompted.

Once the machine is up and running again, launch a PowerShell console. Then unzip the compressed file and move the Docker executables to the system's program files.

Next, use the following PowerShell commands to add the Docker folder location to the system's PATH variable and run the Docker executable as a service.

Set up the PATH variable and Docker service

Set up the PATH variable and Docker service

This will complete the Docker Enterprise setup on Windows Server 2016.

Load and run the image ^

From the PowerShell console, use the docker load command to load the "nano.tar" file (the Docker image) into our current session. Verify the image is loaded and available and the Docker service is running.

Load the Docker image

Load the Docker image

Now run the test container image using the docker run command. If you get results like in the following screenshot, this means installation was successful and the container is running properly.

Run test containers

Run test containers

Conclusion ^

Downloading Docker container images from the Docker Hub or Registry is often restricted on enterprise servers. One workaround is to set up a proxy server to allow such access. But in case this is not available or allowed, you can pull and save a Docker image to a machine (Windows 10) that has internet access. Later, you can export the image as a compressed file and move it to the enterprise server (Windows Server 2016) that cannot access the internet. Once you have the image as a compressed file, you can directly load it using the docker load -i <image file name> command on Windows Server 2016 and run containers with the image.

Win the monthly 4sysops member prize for IT pros

1+

Users who have LIKED this post:

  • avatar
Share

Related Posts

0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*

CONTACT US

Please ask IT administration questions in the forum. Any other messages are welcome.

Sending
© 4sysops 2006 - 2018

Log in with your credentials

or    

Forgot your details?

Create Account