Installing elasticsearch docker image fails on command not found - elasticsearch

I'm trying to install elasticsearch from an image I've created on another machine, however when I create the container it say that the command not found. I've understood that the command is not exported as part of the image, however I can't find the right command to spesify for it to work.
on Machine A I'm creating the image as such:
sudo docker pull elasticsearch
sudo docker save -o "elastic.image.tar" elasticsearch
On machine B I'm importing the image and trying to run it
sudo docker import "elastic.image.tar"
sudo docker run -d elasticsearch
on the docker run I get
docker: Error response from daemon: No command specified.
See 'docker run --help'.
I've also tried the following commands:
sudo docker run -d elasticsearch elasticsearch
sudo docker run -d elasticsearch "/docker-entrypoint.sh elasticsearch"
sudo docker run -d elasticsearch "/usr/share/elasticsearch/docker-entrypoint.sh elasticsearch"
sudo docker run -d elasticsearch "/bin/bash"
None of them worked, all returned responce like:
docker: Error response from daemon: Container command 'XXX' not found or does not exist..
What is the right command to specify here?

Can you try docker load -i elastic.image.tar and call docker run elasticsearch. Check this question to know some differences between save/load and export/import.

Related

Why have I an error message "invalid reference format" when working with Docker?

I'm following the below tutorial and they use docker. I got an error When I tried to mount my local folder to the container.
https://www.youtube.com/watch?v=bhBSlnQcq2k
docker run --name some-nginx -v $(pwd):/usr/share/nginx/html:ro -d -p 8080:80 nginx
I got the following error:
docker: invalid reference format.
I am using Windows 10 PowerShell, Visual Studio Code, and Nginx image. Any ideas are highly appreciated.
with powershell you should use ${PWD} instead of $(pwd)
then you should do
docker run --name some-nginx -v ${PWD}:/usr/share/nginx/html:ro -d -p 8080:80 nginx
possible duplicate of : Mount current directory as a volume in Docker on Windows 10

Run a docker image on Windows results in "oci runtime error: exec: "bash": executable file not found in $PATH."

I'm running Docker on Windows ("Docker Toolbox", not "Docker for Windows").
I've built an image with a rails app inside. It works properly on my Mac OS but stucks on production on Windows.
Using Docker 1.12 and docker-machine 0.8.0 on both machines.
When I create a machine and try to run the container from image, I do:
docker run -it myRepo:myTag bash
which opens me a interactive terminal on Mac OS, but Windows 7 and Windows Server 2011 are both responding with:
"Error response from daemon: oci runtime error: exec: "bash":
executable file not found in $PATH."
I use the MINGW64 shell via the Docker Quickstart Terminal but the old cmd.exe returns the same.
Can anybody help me with this issue? I've tried several hours to find a solution but there are too few answers for Windows.
Thank you in advance!
I also use Windows 7 with MINGW64. Here is what I get using nginx as example:
$docker run -it nginx bash
cannot enable tty mode on non tty input
I don't think you can open a tty using MINGW64.
You can try:
$docker run -i nginx bash
ls
bin
...
You will so no prompt or any indication you are inside the container. Just run ls and it should work inside your container.
Another option is to try to use winpty for the tty:
$ winpty docker run -it myRepo:myTag bash
root#644f59e6f818:/#
Have you tried?
$ winpty docker run -it myRepo:myTag /bin/bash
I haven't got the problem you are mentioning but I have seen it before when I was mapping volumes.
If you are mapping volumes using MINGW64, you will need to add an extra / before the local mapping. For example:
docker run -p 8080:80 -v "/$PWD":/var/share/nginx/html nginx
Let me know your findings.

Error while running a container using docker

I have installed docker in my machine
I could successfully pull images from the repository and the pulled images are clearly listed when I see the list of images pulled.
The docker service was also started using
sudo service docker start
However, when I try to run the same using the command,
sudo docker run -it ubuntu:12.04
I am getting the following error
docker: Error response from daemon: Container command '/bin/bash' not
found or does not exist..
The issue remains the same for any image that I have tried with
What could be the reason for this issue?
It depends on your version of docker, but check if you have issue 23411, where adding a workdir is needed:
sudo docker run --workdir /var -it ubuntu:12.04
There seem to be some recent bug in start.go, and a PR in progress.

Creating image in Docker fails

I'm trying to create my own image on Docker container. I wrote my Docker file as given below:
FROM ubuntu:latest
RUN apt-get update && apt-get install astyle ruby
But on running
docker build -t username/newname .
It gives an error Error response from daemon:
mkdir /var/lib/docker/tmp/docker-builder705720973: no space left on device
I'm new to Docker. Any help would be appreciated. Thanks in advance
You must have pulled a lot of images i guess. Check all your images using following command:
sudo docker images
If you see many images, try deleting some that you don't need anymore using the following command
sudo docker rmi <iamge_id>
Hope that helps

Phundament under Windows - "Interactive mode is not yet supported on Windows"

I have Docker Toolbox installed under Windows 7. The Docker daemon is running inside a VM (the default behavior of Docker Toolbox).
I am trying to get Phundament running using the default tutorial.
It all works fine until I reach this command:
docker-compose run php composer install
It results in:
I've successfully attached to the running container using docker exec -it <container ID> bash but when I do a ls /app command on any of the two containers I get no files in that directory. In effect, the attempt to run composer install there fails.
I tried attaching to both containers and the result is identical.
I also noticed that behavior just recently, it's sadly a limitation of docker-compose on Windows.
For the command you mentioned you can actually run
docker-compose run -d php composer install
As general workarounds...
use docker exec -it app_php_1 bash
see also https://getcarina.com/docs/troubleshooting/troubleshooting-cannot-enable-tty-mode-on-windows/
if you don't really need an interactive shell, you could just run a command or script, like docker-compose run -d php setup.sh
Note: I need to double-check the above suggestions on a real Windows testing system.
PS: I am the author if Phundament. I've also just created an issue for this.
Please try:
winpty docker-compose run php composer install
it works for example:
winpty docker run --rm -it debian bash

Resources