docker
Should you install nginx inside docker? [closed]
This may get closed as opinion based, but for what it’s worth my opinion is that docker should be involved in networking up to the transport layer (TCP/UDP) but no higher (HTTP). Thus I would say no you should not install nginx as a reverse proxy directly on your docker host directly and yes you … Read more
How do I check if my local docker image is outdated, without pushing from somewhere else?
You can query the registry API for the image digest and compare it to that of what you’ve pulled. $ cat digest-v2.sh #!/bin/sh ref=”${1:-library/ubuntu:latest}” repo=”${ref%:*}” tag=”${ref##*:}” acceptM=”application/vnd.docker.distribution.manifest.v2+json” acceptML=”application/vnd.docker.distribution.manifest.list.v2+json” token=$(curl -s “https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull” \ | jq -r ‘.token’) curl -H “Accept: ${acceptM}” \ -H “Accept: ${acceptML}” \ -H “Authorization: Bearer $token” \ -I -s “https://registry-1.docker.io/v2/${repo}/manifests/${tag}” $ ./digest-v2.sh … Read more
My Docker container does not have IP address. Why?
You are starting your container with the –net host option which means your container will run on your host network. Check here for more info. So your container will be accessible on the IP of your host. A very basic example: $ docker run –net=host -d jenkins This will run jenkins on your real host … Read more
Can docker compose skip build if the image is present?
You can use docker-compose pull to fetch images. Then if they are present already, Compose will not try to build them again. To be really sure to avoid rebuilds, you can use –no-build. docker-compose pull docker-compose up -d –no-build Your real problem is that you are specifying a build context, but then trying to use … Read more
Copy entire directory from container to host
EDIT As a result of running ‘pwd’ your should run the Docker cp command as follows: docker cp 143v73628670f:/opt/jboss/keycloak/themes ~/Development/Code/Git/keycloak-recognition-login-branding You are forgetting the trailing “https://stackoverflow.com/”. Therefore your command should look like this: docker cp 143v73628670f:/keycloak/themes/ ~/Development/Code/Git/keycloak-recognition-login-branding Also, you could make use of Docker volumes, which allows you to pass a local directory into the … Read more
How to source a script with environment variables in a docker build process?
Each Dockerfile RUN step runs a new container and a new shell. If you try to set an environment variable in one shell, it will not be visible later on. For example, you might experiment with this Dockerfile: FROM busybox ENV FOO=foo1 RUN export FOO=foo2 RUN export BAR=bar CMD echo FOO is $FOO, BAR is … Read more
How can I get a Docker image’s label if the label name has a “.” in it?
The index function is what I was looking for. It can lookup arbitrary strings in the map. $ docker inspect -f ‘{{ index .Config.Labels “com.wherever.foo” }}’ foo bang