January-13th-2019, 04:46 PM
(This post was last modified: January-13th-2019, 05:40 PM by Armin@netPI.)
Well Rahul,
here is a general hint how I deal with non working commands while I have no idea why they don't work:
In such cases I go back to my Dockerfile and remove all lines that do not work correctly. Then I let Docker rebuild the image based on the working Dockerfile.
At the end I have a proper image as an output ... of course not the final one that I want ... but a working one.
Afterwards I am starting a container of this working image with the following command and "jump" into the image on console basis.
The -it option is very important since it redirects all consoles outputs and keystrokes of your container to the original host console you started on your raspberry.
You could for example reduce your Dockerfile to the absolute minimum like
then build it (-t command tags the image and give it a name)
then run it with
The --entrypoint option specifies the first command that is called when a container is started from an image and hence starts a shell console based on /bin/bash command.
Now you are "in" the container and you can try to run your initial "eclipse" command yourself that didn't work to understand why it does not work properly in the container. With this procedure you can stepwise try command, recheck them and find out the correct Linux commands. With this knowledge you can easily complete your Dockerfile with the correct command list. In Dockerfile you have just to add the preceeding "RUN" to each line.
Use the following command to exit the container:
here is a general hint how I deal with non working commands while I have no idea why they don't work:
In such cases I go back to my Dockerfile and remove all lines that do not work correctly. Then I let Docker rebuild the image based on the working Dockerfile.
At the end I have a proper image as an output ... of course not the final one that I want ... but a working one.
Afterwards I am starting a container of this working image with the following command and "jump" into the image on console basis.
Code:
docker run -it --entrypoint=/bin/bash <image-name or image-id>
The -it option is very important since it redirects all consoles outputs and keystrokes of your container to the original host console you started on your raspberry.
You could for example reduce your Dockerfile to the absolute minimum like
Code:
FROM raspbian/stretch
RUN apt-get update
RUN apt-get install -y eclipse
then build it (-t command tags the image and give it a name)
Code:
docker build -t mycontainer .
then run it with
Code:
docker run -it --entrypoint=/bin/bash mycontainer
The --entrypoint option specifies the first command that is called when a container is started from an image and hence starts a shell console based on /bin/bash command.
Now you are "in" the container and you can try to run your initial "eclipse" command yourself that didn't work to understand why it does not work properly in the container. With this procedure you can stepwise try command, recheck them and find out the correct Linux commands. With this knowledge you can easily complete your Dockerfile with the correct command list. In Dockerfile you have just to add the preceeding "RUN" to each line.
Use the following command to exit the container:
Code:
exit
„You never fail until you stop trying.“, Albert Einstein (1879 - 1955)