Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

Docker Set Environment Variables for Container in Windows

Jan 18, 2017
Introduction:

Here we will learn how to set environment variables for docker container in windows with example or how to pass environment variables to existing / running docker container in windows with example or add environment variables to existing docker container in windows with example. By using “–e” flag we can easily pass or set environment variables for existing or running docker container in windows.

Description:


By using docker I created container in windows after that I got requirement like need to add environment variables for existing container for that I wrote script by using “-e” flag like as shown below


docker run -d -t -i -e environment_variable container_name

In above syntax we need to replace environment_variable with your required variable name and container_name with your containerid

Example

Following is the example of setting environment variable for docker container in windows.


docker run -d -t -i -e KAFKA_ADVERTISED_HOST_NAME = 'staging' container_name

This is how we can set environment variables for the container which is already running based on our requirements.

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

0 comments :

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.