Docker: How to clear the logs properly for a Docker container?

First the bad answer. From this question there’s a one-liner that you can run: instead of echo, there’s the simpler: or there’s the truncate command: I’m not a big fan of either of those since they modify Docker’s files directly. The external log deletion could happen while docker is writing json formatted data to the file, resulting … Read more

build context for docker image very large

The Docker client sends the entire “build context” to the Docker daemon. That build context (by default) is the entire directory the Dockerfile is in (so, the entire rpms tree). You can setup a .dockerignore file to get Docker to ignore some files. You might want to experiment with it. Alternatively, you can move your rpms folder one directory level above your Dockerfile, and … Read more

Correct way to detach from a container without stopping it

Update: As mentioned in below answers Ctrl+p, Ctrl+q will now turn interactive mode into daemon mode. Well Ctrl+C (or Ctrl+\) should detach you from the container but it will kill the container because your main process is a bash. A little lesson about docker. The container is not a real full functional OS. When you run a container the process you launch take the … Read more

How does docker compare to openshift?

The primary difference is that Docker as a project is focused on the runtime container only, whereas OpenShift (as a system) includes both the runtime container as well as the REST API, coordination, and web interfaces to deploy and manage individual containers. Comparing just the runtime containers, OpenShift and Docker both use kernel isolation features … Read more