Top "Dockerfile" questions

A Dockerfile is a file containing instructions to build a Docker image

docker-compose, run a script after container has started?

I have a service that I am bringing up through Rancher via docker-compose. The issue I am running into is …

docker docker-compose dockerfile rancher
Externalising Spring Boot properties when deploying to Docker

In my Spring Boot app I want to externalise the properties to run in a Docker container. When first deployed, …

docker spring-boot dockerfile spring-boot-configuration
Difference between RUN and CMD in a Dockerfile

I'm confused about when should I use CMD vs RUN. For example, to execute bash/shell commands (i.e. ls …

docker dockerfile
Docker expose all ports or range of ports from 7000 to 8000

Can I specify a port range in a Dockerfile EXPOSE 7000-8000 and when running the container bind all these exposed …

docker dockerfile
How to name Dockerfiles

I'm unsure of how to name Dockerfiles. Many on GitHub use Dockerfile without a file extension. Do I give them …

docker dockerfile naming-conventions
ARG or ENV, which one to use in this case?

This could be maybe a trivial question but reading docs for ARG and ENV doesn't put things clear to me. …

docker arguments environment-variables dockerfile
How to give folder permissions inside a docker container Folder

I am creating a folder inside my Dockerfile and I want to give it a write permission. But I am …

docker permissions dockerfile permission-denied
Dockerfile CMD instruction will exit the container just after running it

I want to setup some configuration when my container starts, for this I am using shell scripts. But my container …

bash shell docker sh dockerfile
How do I use Docker environment variable in ENTRYPOINT array?

If I set an environment variable, say ENV ADDRESSEE=world, and I want to use it in the entry point …

docker dockerfile
Can't create a docker image for COPY failed: stat /var/lib/docker/tmp/docker-builder error

I want to create a docker image. This is my work directory: Dockerfile.in test.json test.py And this …

python docker dockerfile docker-image