I have built docker image using following command. (Used com.spotify:docker-maven-plugin:0.3.3 maven plugin). I am using Docker Tool Box in Windows.
mvn clean package docker:build
It gave SUCCESS with following description.
Successfully built d27ae98a8879
[INFO] Built localhost/my-tt-server
[INFO] Tagging localhost/my-tt-server with 1.1.x-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
After this, if I run 'docker ps -a', it should have displayed this new image. But I am not seeing any image related to this. Hence I am not able to start/run the new image.
I am not able to run 'docker-compose up my-tt-server' using following configuration in docker-compose.yml
my-tt-server:
container_name: my-tt-server
image: localhost/my-tt-server:1.1.x-SNAPSHOT
ports:
- "21883:1883"
- "28000:8000"
It gives following error
Creating my-tt-server
←[31mERROR←[0m: Container command not found or does not exist.
I am not sure where it went wrong.
Please help me to solve this. Looks like maven plugin is not correctly deploying the image. How to make it deploy correctly?
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.3.3</version>
<configuration>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<imageName>localhost/my-tt-server</imageName>
<imageTags>
<imageTag>${project.version}</imageTag>
</imageTags>
<forceTags>true</forceTags>
</configuration>
</plugin>
No:
docker ps -a
list the containers, not the images.Do a
docker images
to see the list of images, and launch a container withdocker run <anImage>
.If your image is built locally, the
image
directive of docker-compose should be:Make sure there is no extra space at the end of that line.
Regarding the error message "
Container command not found or does not exist
", see issue 20789:or