I am having a docker file which has following line in it
%include=../doxygen
If i try to run the docker command using this docker file, it gives me error
unknown instruction: %INCLUDE=../DOXYGEN
what is the purpose of %include in dockerfile?
is there anything that in need to pass in docker command to make it run?
Related
when i am using the CMD parameter, docker build is success.
But To run the docker container, container is existing immediately.
Try to read about docker & how it works after container is started.
More about how to read logs of container: https://docs.docker.com/engine/reference/commandline/logs/
I am trying to set the PATH environment variable inside the container using python docker api but doesnt seems to work , the container is not starting
does anybody has idea how to set the PATH env variable, other env variables works file.
I am seeing the below error
OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown
(exitCode, socConn) = self.container.exec_run('bash -e build/otin/BashCheckGCCVersion.sh',socket=True,environment=["PATH=/usr/lib64/ccache"])
or
environment=[
"CCACHE_DIR=/work/.ccache",
"PATH=/usr/lib64/ccache",
"BUILDS_ALL_TIME=" + sys.argv[2],
"PATCH_10.2=" + sys.argv[1]],
working_dir="/OTINBuild",
please share the api details (or) the python script full details - here its minimal includes your docker file (docker build cmd) .Refer below for the syntax and whether you are trying to override the environment variables set by the docker image build process ?
Ref: https://docker-py.readthedocs.io/en/stable/api.html
exec_create(container, cmd, stdout=True, stderr=True, stdin=False, tty=False, privileged=False, user='', environment=None, workdir=None, detach_keys=None)
environment (dict or list) – A dictionary or a list of strings in the following format ["PASSWORD=xxx"] or {"PASSWORD": "xxx"}.
Does the docker image has bash command. Try other generic command like sh, ls instead of bash.
If you use the dictionary to set up your environment variable it will work like this:
environment = {"Name_Variable":"Name_Path","Name_Variable2":"Name_Path2"...}
(exitCode, socConn) = self.container.exec_run('bash -e build/otin/BashCheckGCCVersion.sh',socket=True,environment=environment)
If you try to see if it work with the following command :
docker exec -it "Name_Container" echo $Name_Variable
It won't show you the value.
The terminal is executing the $Name_Variable, before "sending" it to docker.
You have to enter in your container using the bash and do echo $Name_Variable.
I want to run a command like:
docker run --network host ...
But I can't actually change my docker run command. Is there another way to have Docker do essentially the same thing, like reading from a config file or environment variables?
For example, I know I can set a HOSTNAME env in my Dockerfile, which accomplishes the same thing as
docker run --hostname my_hostname
Is there a way to do this more generally with other arguments?
Thanks.
I have created a docker image which is a python script based on a centos image. This image is working in the host system. Then I converted that image in tar.gz format. After that when I imported that tar.gz file into docker host(in a ubuntu system), it is done properly and the docker images list shows me the image listed in there. Then I tried to run the container in interactive mode using the following command:
$docker run -it image_name /bin/bash
it throws the following error:
docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\"/bin/bash\\\": stat /bin/bash: no such file or directory\"\n".
Although docker run -it image_name /bin/bash command is working for all other images in my system. I tried almost all the means, but got no output apart from this error.
docker run -it image_name /bin/sh works for me! (Docker image, like Alpine, does not have /bin/bash).
I've just run into the same issue after updating Docker For Windows. It seems that it corrupted some image layers.
I cleared all the cached containers and images by running:
docker ps -qa|xargs docker rm -f
docker images -q|xargs docker rmi
The last command returned a few errors (some returned images didn't exist anymore).
Then I restarted the service and everything was running again.
I had the same issue, and it got resolved, after following the steps described in this post...
https://www.jamescoyle.net/how-to/1512-export-and-import-a-docker-image-between-nodes
Instead of saving the docker image (I) as .tar and importing, we need to commit the exited container, based on the image (I), as new image (N).
Then save the newly committed image (N) as .tar file, for importing into a new environment.
Hope this helps...
docker_admin#Ashoka:~$ sudo docker run sqldb
exec format error
Error response from daemon: Cannot start container 4e1b251d50ceda05f7b4dd0d3eebd13a731bab0f9a5ed4486f4303d8b5f5b272: [8] System error: exec format error
I try to run the image it shows this error, but when I run the same image in interactive mode it runs successful.
Do you know why?
This message is produced when the kernel, for whatever reason, doesn't know how to handle the given executable format. It's a problem that's often associated with scripts that don't include a shebang line, or binaries that are incompatible with your system.
Since you're able to run the image interactively, you probably have a badly written script somewhere in your container.
See: https://github.com/moby/moby/issues/10668
Try run command using image TAG, execute docker images and get your TAG.
sudo docker run sqldb:1.0
Maybe you need any initial command too
I have had this problem just now, in an Alpine 3.5 container running in a Mint 18 host. It's not a very helpful error, and as far as I can tell there is no feature to inspect logs unless the container keeps on running.
The problem was this line in my Dockerfile:
ENTRYPOINT ["sleep 500"]
I'm using sleep at present so I can shell into the container and install a few things experimentally before committing it to the Dockerfile. In fact this would have happened if I had tried to put any command with parameters into a single ENTRYPOINT entry. It should have been:
ENTRYPOINT ["sleep", "500"]