docker-cmd Questions

20

Solved

In Dockerfiles there are two commands that look similar to me: CMD and ENTRYPOINT. But I guess that there is a (subtle?) difference between them - otherwise it would not make any sense to have two ...
Anglomania asked 4/2, 2014 at 13:4

10

Solved

I'm confused about when should I use CMD vs RUN. For example, to execute bash/shell commands (i.e. ls -la) I would always use CMD or is there a situation where I would use RUN? Trying to understand...
Samp asked 26/5, 2016 at 13:11

6

Solved

Inside my Dockerfile: ENV PROJECTNAME mytestwebsite CMD ["django-admin", "startproject", "$PROJECTNAME"] Error: CommandError: '$PROJECTNAME' is not a valid project na...
Cannibalize asked 6/11, 2016 at 20:59

8

Solved

I have a nodejs app can take two parameters when started. For example, I can use node server.js 0 dev or node server.js 1 prod to switch between production mode and dev mode and determine if it s...
Taiwan asked 29/11, 2016 at 18:29

4

Solved

How you can replace the cmd based on the docker documentation: https://docs.docker.com/engine/reference/builder/#cmd You can override the CMD command Dockerfile: RUN chmod +x /srv/www/bin/* & c...
Tristan asked 6/10, 2015 at 21:8

2

Solved

I am creating a docker image using a Dockerfile. I would like to execute some scripts while starting the docker container. Currently I have a shell script to execute all the necessary processes ...
Halvorsen asked 22/7, 2015 at 9:27

5

Solved

I have built a base image from Dockerfile named centos+ssh. In centos+ssh's Dockerfile, I use CMD to run ssh service. Then I want to build a image run other service named rabbitmq,the Dockerfile: ...
Chinkiang asked 16/5, 2014 at 4:6

2

Solved

I want to create a Docker Image that acts as an executable for which the user passes a token as an environment variable. The executable has sub commands that the user should pass via dockers CMD (t...

4

Solved

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?
Relax asked 25/9, 2014 at 7:26

1

Solved

I want to pass in a parameter into a docker CMD. For example, if the contents of Dockerfile are FROM ubuntu:15.04 CMD ["/bin/bash", "-c", "cat", "$1"] Then I want to run as follows: docker buil...
Lagos asked 13/9, 2015 at 20:54
1

© 2022 - 2024 — McMap. All rights reserved.