I am not saying tag sampleimage:0.1 is wrong. But as suggested by fauza I have tried removing the version number(0.1) from the command but still it is giving the same error. So having version number as suffix in the image name is not an issue. Issue was some where else which I could not figure it out.
Do you think issue is with content of the dockerfile?
To make things clear can you copy and paste the exact contents of the Dockerfile and the build command here or at http://paste.ubuntu.com/ and share us the link. So that we can finalise where the exact issue is. I believe @programmerq is write, because your build command seems to be fine.
I ran docker build based on your Dockerfile and build command and I am getting a different error which can be easily fixed.
docker build -t sampleimage:0.1 .
Sending build context to Docker daemon 2.048 kB
Step 0 : FROM ubuntu:14.04
---> 91e54dfb1179
Step 1 : RUN add-apt-repository ppa:webupd8team/java
---> Running in b247f6f2746a
/bin/sh: 1: add-apt-repository: not found
The command '/bin/sh -c add-apt-repository ppa:webupd8team/java' returned a non-zero code: 127
I dont find any reason for you to get the error you mentioned in the first post. The only other reason for error I can imagine is , as you are working on Windows may be there are some non-printable characters in your Dockerfile. This is a wild guess, I am not sure. To rule out that can you create a fresh Dockerfile and test it.
I have tried with new dockerfile with same content. Now I am noticing different error which is similar to the error you posted in your response above. Your guess is correct.
With new Dockerfile below is the error observed in my docker environment
docker build -t sampleimage:0.1 .
Sending build context to Docker daemon 2.048 kB
Step 0 : FROM ubuntu:14.04
—> 91e54dfb1179
Step 1 : RUN add-apt-repository ppa:webupd8team/java
—> Running in e1c2c8a41069
/bin/sh: 1: add-apt-repository: not found
The command ‘/bin/sh -c add-apt-repository ppa:webupd8team/java’ returned a non-zero code: 127
Wow, great news. Glad to know that it fixed your issue. The present issue you can fix by installing software-properties-common using apt-get before using add-apt-respository.
apt-get install software-properties-common
Can you please mark the answer as solution if possible.
I have tried this option ( apt-get install software-properties-common) and executed the build command with latest include. I have noticed some other error with stacktrace details in VM console. But I could not get all the error details due to window size. Can you tell me whether these stacktrace will be directed to any of the Docker log files in C drive? If yes, where can we find the stacktrace details?
I have tried to find out the Docker log files in this folder location
( C:\Users\xyz.docker\machine\machines\default\default\Logs) . But no luck. Could not find error details. Probably this is not the correct log file to verify the docker logs.
Would you please suggest me where can I find the correct log files to verify the build command output?
Possibly you are describing about a boot2docker vm kernel crash . Do you have any screenshot to share? Also can you reboot the VM and try your build command again.
Thanks for your support Ranjan.
Yes, I am referring boot2docker vm kernel.
I have rebooted the VM and executed the build command again. Still the same problem persists.
I could not take the screen shot of the window.
Would you provide me the log file details to see the build error details?