/sbin/ip route|awk '/default/ { print $3 }'
As @MichaelNeale noticed, there is no sense to use this method in Dockerfile
(except when we need this IP during build time only), because this IP will be hardcoded during build time.
More Related Contents:
- Docker container doesn’t expose ports when –net=host is mentioned in the docker run command
- How is Docker different from a virtual machine?
- How to run a cron job inside a docker container?
- Communication between multiple docker-compose projects
- How can I add a volume to an existing Docker container?
- Docker not found when building docker image using Docker Jenkins container pipeline
- How to push a docker image to a private repository
- denied: requested access to the resource is denied: docker
- standard_init_linux.go:190: exec user process caused “no such file or directory” – Docker
- Why is docker build not showing any output from commands?
- Kubernetes Pod Warning: 1 node(s) had volume node affinity conflict
- Pass environment variable into a Vue App at runtime
- Docker app server ip address 127.0.0.1 difference of 0.0.0.0 ip
- How to continue a Docker container which has exited
- How to use the host network, and any other user-defined network together in Docker-Compose?
- How to mount volume from container to host in Docker?
- Forcing docker to use linux/amd64 platform by default on macOS
- Connect to Kafka on host from Docker (ksqlDB)
- How to move Docker containers between different hosts?
- Get container ID from Docker buildkit for interactive debugging
- How to execute command from one docker container to another
- How do I download Docker images without using the pull command?
- Is there a maximum number of containers running on a Docker host?
- apt-get update fails with 404 in a previously working build
- how do you manage secret values with docker-compose v3.1?
- Dockerfile: Output of RUN instruction into a Variable
- How to write data to host file system from Docker container
- Is there a way to force docker-machine to create vm with a specific ip?
- how to set ulimit / file descriptor on docker container the image tag is phusion/baseimage-docker
- What is the purpose of the file “docker.sock”?