Linked Questions

1 vote
1 answer
4k views

I have seen some images that based on the inspect have both CMD and ENTRYPOINT set. What is the idea of this? What use cases are served when both are set?
Jim's user avatar
  • 4,529
3138 votes
17 answers
1.1m views

What is the difference between the COPY and ADD commands in a Dockerfile, and when would I use one over the other? COPY <src> <dest> The COPY instruction will copy new files from <...
Steve's user avatar
  • 55.8k
48 votes
2 answers
64k views

I have a simple spring-boot project: -resources -application.yaml -application-test.yaml And I have this Dockerfile: FROM openjdk:8-jdk-alpine EXPOSE 8080 ADD micro-boot.jar micro-boot.jar ...
ip696's user avatar
  • 7,184
53 votes
3 answers
48k views

I am creating an image from another image that set a specific entrypoint. However I want my image to have default one. How do I reset the ENTRYPOINT? I tried the following Dockerfile: FROM some-...
Eugene Dounar's user avatar
67 votes
2 answers
32k views

What is the difference between shell and exec form for CMD: CMD python my_script.py arg vs. CMD ["python", "my_script.py", "arg"] ENTRYPOINT: ENTRYPOINT ./bin/main vs. ...
Sheena's user avatar
  • 16.3k
33 votes
3 answers
30k views

As per Docker documentation: There can only be one CMD instruction in a Dockerfile. If you list more than one CMD then only the last CMD will take effect. I wish to execute a simple bash script(which ...
kumar's user avatar
  • 2,610
39 votes
1 answer
85k views

I want to understand how CMD and ENTRYPOINT works. So, I just created a very simple Dockerfile FROM scratch CMD echo "Hello First" ENTRYPOINT echo "Hello second" Then I build image of this : ...
Mehraj Malik's user avatar
  • 15.9k
24 votes
3 answers
29k views

I have read the docs about CMD and ENTRYPOINT https://docs.docker.com/engine/reference/builder/#entrypoint Here, they have mentioned in the table that "NO CMD and NO ENTYRPOINT is not allowed&...
Ashwani's user avatar
  • 1,490
26 votes
3 answers
22k views

I am creating Jenkins pipeline for running terraform on a Docker container. Here is my pipeline script. pipeline { agent { docker { image 'hashicorp/terraform:full' ...
Param's user avatar
  • 373
23 votes
4 answers
18k views

Let's say a docker container has been run with docker run and then stopped with docker stop. Will the CMD command be executed after a docker start?
jchristin's user avatar
  • 8,196
22 votes
3 answers
100k views

There is no such file by name entrypoint.sh in my workspace. But below instruction in docker-compose.yml is referring it: builder: build: ../../ dockerfile: docker/dev/Dockerfile volumes: ...
overexchange's user avatar
  • 17.3k
31 votes
2 answers
24k views

I created a docker container with a python script. The python script takes an input file, does some processing and saves output file at some specified location. docker run /app/script.py --input /...
Abhishek Thakur's user avatar
11 votes
3 answers
44k views

I create a container docker. Which should give the following: docker run --rm container1 > Hello World! docker run --rm container1 Bob > Hello Bob! My Dockerfile: FROM ubuntu:14.04 ENTRYPOINT ...
Ulybin Vitaliy's user avatar
16 votes
1 answer
34k views

I find when using docker run I sometimes don't need to add a "command", while sometimes a "command" is a must. E.g. when running the ubuntu image a command isn't required: # docker run ubuntu # ...
Nan Xiao's user avatar
  • 17.7k
5 votes
2 answers
33k views

I have created docker images using the below Dockerfile. FROM ubuntu RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ net-tools \ && apt-get clean \...
user51's user avatar
  • 10.6k

15 30 50 per page
1
2 3 4 5
8