To change into another directory use WORKDIR. All the RUN, CMD and ENTRYPOINT commands after WORKDIR will be executed from that directory.
RUN git clone XYZ
WORKDIR "/XYZ"
RUN make
More Related Contents:
- How do I pass environment variables to Docker containers?
- Add a volume to Docker, but exclude a sub-folder
- Docker not found when building docker image using Docker Jenkins container pipeline
- Multiple FROMs – what it means
- How do I use Docker environment variable in ENTRYPOINT array?
- How to update /etc/hosts file in Docker image during “docker build”
- Conditional COPY/ADD in Dockerfile?
- denied: requested access to the resource is denied: docker
- standard_init_linux.go:190: exec user process caused “no such file or directory” – Docker
- what is docker run -it flag?
- How to pass arguments within docker-compose?
- Conditional ENV in Dockerfile
- Externalising Spring Boot properties when deploying to Docker
- COPY with docker but with exclusion
- ARG or ENV, which one to use in this case?
- How can I use a variable inside a Dockerfile CMD?
- How to fill user input for interactive command for “RUN” command?
- Why the “none” image appears in Docker and how can we avoid it
- How to mount local volumes in docker machine
- Is there a way to combine Docker images into 1 container?
- How do I set environment variables during the build in docker
- How to set image name in Dockerfile?
- How to pass ARG value to ENTRYPOINT?
- Multiple commands on docker ENTRYPOINT
- Dockerfile build – possible to ignore error?
- Docker container doesn’t expose ports when –net=host is mentioned in the docker run command
- How to pass arguments to a Dockerfile?
- Differences Between Dockerfile Instructions in Shell and Exec Form
- Can I mount same volume to multiple docker containers
- How to source a script with environment variables in a docker build process?