Help! Why isn’t my environment variable setting with docker run -e?

0
11
Asked By CuriousCoder92 On

I'm new to Docker and trying to figure out how to set an environment variable. I built a container using a git fork image, but when I attempt to run the command `docker run -e VAR=VAL`, I keep getting an error that says "docker run requires at least 1 argument." I even created a .env file in my project's root directory. Can someone help me figure out what I'm missing here?

2 Answers

Answered By NewbieNina77 On

Definitely remember to include the image name! Your command should have the environment variable setting followed by the image name, like `docker run -e VAR=VAL your_image_name`. If you're still stuck, feel free to share the complete command you're trying to run.

Answered By TechieTom82 On

It looks like you might be missing the image name in your command. After `docker run -e VAR=VAL`, you need to specify the image you want to run. So it should look something like this: `docker run -e VAR=VAL your_image_name`. Let me know if you need more help!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.