ARG or ENV, which one to use in this case?

From Dockerfile reference: The ARG instruction defines a variable that users can pass at build-time to the builder with the docker build command using the –build-arg <varname>=<value> flag. The ENV instruction sets the environment variable <key> to the value <value>. The environment variables set using ENV will persist when a container is run from the … Read more

COPY with docker but with exclusion

Create file .dockerignore in your docker build context directory (so in this case, most likely a directory that is a parent to node_modules) with one line in it: **/node_modules although you probably just want: node_modules Info about dockerignore: https://docs.docker.com/engine/reference/builder/#dockerignore-file

Docker and –userns-remap, how to manage volume permissions to share data between host and container?

If you can prearrange users and groups in advance, then it’s possible to assign UIDs and GIDs in such specific way so that host users correspond to namespaced users inside containers. Here’s an example (Ubuntu 14.04, Docker 1.10): Create some users with fixed numeric IDs: useradd -u 5000 ns1 groupadd -g 500000 ns1-root groupadd -g … Read more

How do I mount a host directory as a volume in docker compose

Checkout their documentation From the looks of it you could do the following on your docker-compose.yml volumes: – ./:/app Where ./ is the host directory, and /app is the target directory for the containers. EDIT:Previous documentation source now leads to version history, you’ll have to select the version of compose you’re using and look for … Read more

How can I delete Docker’s images?

In order to delete all images, use the given command docker rmi $(docker images -q) In order to delete all containers, use the given command docker rm $(docker ps -a -q) Warning: This will destroy all your images and containers. It will not be possible to restore them! This solution is provided by Techoverflow.net.

Elasticsearch docker container in non-prod mode to eliminate vm.max_map_count=262144 requirement

You can run your docker in development mode and create a single node ES cluster by following official ES link on single node ES cluster. As mention in this link. To start a single-node Elasticsearch cluster for development or testing, specify single-node discovery to bypass the bootstrap checks: In-short all you need to do is … Read more