Questions tagged [docker-run]

214 questions
730
votes
8 answers

What is the difference between "expose" and "publish" in Docker?

I'm experimenting with Dockerfiles, and I think I understand most of the logic. However, I don't see the difference between "exposing" and "publishing" a port in this context. All the tutorials I have seen first include the EXPOSE command in the…
user1496984
  • 10,957
  • 8
  • 37
  • 46
691
votes
22 answers

Docker - Name is already in use by container

Running the docker registry with below command always throws an error: dev:tmp me$ docker run \ -d --name registry-v1 \ -e SETTINGS_FLAVOR=local \ -e STORAGE_PATH=/registry \ -e SEARCH_BACKEND=sqlalchemy \ -e LOGLEVEL=DEBUG…
Rubytastic
  • 15,001
  • 18
  • 87
  • 175
556
votes
23 answers

Docker container will automatically stop after "docker run -d"

According to tutorial I read so far, use "docker run -d" will start a container from image, and the container will run in background. This is how it looks like, we can see we already have container id. root@docker:/home/root# docker run -d…
J John
  • 5,591
  • 3
  • 11
  • 9
102
votes
13 answers

Unable to find docker image locally

I was following this post - the reference code is on GitHub. I have cloned the repository on my local. The project has got a react app inside it. I'm trying to run it on my local following step 7 on the same post: docker run -p 8080:80…
Zameer Ansari
  • 28,977
  • 24
  • 140
  • 219
61
votes
5 answers

How do I run a sql file of inserts through docker run?

Given a file with a SQL insert: INSERT INTO countries (id, country_code, name) VALUES (1, 'AF', 'Afghanistan'), (2, 'AL', 'Albania'); I would like to run the file by using the docker run command on a container that is running postgres. I've…
JZ.
  • 21,147
  • 32
  • 115
  • 192
39
votes
6 answers

How to run a pulled images - docker

I'm trying to run a pulled image without any success. I pulled an image from AWS using the Image URI. when I run docker images I can see my pulled image: REPOSITORY TAG IMAGE ID …
Bella
  • 937
  • 1
  • 13
  • 25
30
votes
5 answers

Set GOOGLE_APPLICATION_CREDENTIALS in Docker

I want to set GOOGLE_APPLICATION_CREDENTIALS inside my docker container using my key.json file but I don't want to copy this file into my container.
katakuri
  • 327
  • 1
  • 3
  • 14
13
votes
5 answers

Permission denied to Docker daemon socket at unix:///var/run/docker.sock

I have this Dockerfile: FROM chekote/gulp:latest USER root RUN apt-get update \ && apt-get upgrade -y \ && apt-get install -y sudo libltdl-dev ARG dockerUser='my-user-name'; ARG group='docker'; # crate group if not exists RUN if !…
Jimmix
  • 5,644
  • 6
  • 44
  • 71
13
votes
3 answers

Pass ARG to ENTRYPOINT

Say I have this in a Dockerfile: ARG FOO=1 ENTRYPOINT ["docker.r2g", "run"] where I build the above with: docker build -t "$tag" --build-arg FOO="$(date +%s)" . is there a way to do something like: ENTRYPOINT ["docker.r2g", "run", ARG FOO] //…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
11
votes
2 answers

docker-pr proc already listening on port 80? Installed docker with snappy on Ubuntu

I ran this: docker run -ti -p 80:80 --name esproxy "$tag" but I get this error: docker: Error response from daemon: driver failed programming external connectivity on endpoint esproxy …
user11612258
11
votes
4 answers

How to run the docker image with tag

I have a docker image with tag. I want to run the hello-world image with TAG . How can I do that?
Ghil Maan
  • 581
  • 2
  • 4
  • 11
9
votes
2 answers

Write to stdin of running docker container

Say I run a docker container as a daemon: docker run -d foo is there a way to write to the stdin of that container? Something like: docker exec -i foo echo 'hi' last time I checked the -i and -d flags were mutually exclusive when used with the…
user12374570
9
votes
3 answers

starting container process caused "exec: > \"exec\": executable file not found in $PATH": unknown

I have this Dockerfile: FROM 939fj39f3932.dkr.ecr.us-west-2.amazonaws.com/teros_keys:8e31674 WORKDIR /zoom COPY app.sh . ENTRYPOINT ["exec", "/zoom/app.sh"] CMD [] I build it and it works fine. Then I run it with: docker run --rm -d \ -e…
user11810894
9
votes
3 answers

Translate docker run into subcomponents

I have this docker run command: docker run --rm --name=gitleaks \ -v "/keys/ssh/values:/root/.ssh" \ zricethezav/gitleaks \ --ssh-key='bucket' \ --repo "$line" I tranlated it to this: docker create zricethezav/gitleaks…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
9
votes
1 answer

docker run --name vs --hostname difference as command line option (ping: bad address)

1.What is the difference between --name and --hostname in docker run command? 2.Why foo can't reach bar by its hostname = barhost ? create network and two containers connected to it: docker network create test docker run --rm -dit --name bar…
Jimmix
  • 5,644
  • 6
  • 44
  • 71
1
2 3
14 15