Posted on February 27, 2020, 12:12 pm, by Rhys, under
devops.
Sometimes you need to know if you’re inside a docker container from the shell. Here’s how you can do that.. First spin up a container.. docker run -ti –rm ubuntu You can perform a cat on the cgroups section of your process in /proc. N.B. self means the calling process… cat /proc/self/cgroup In a docker […]
Posted on March 17, 2019, 2:42 pm, by Rhys, under
devops.
I received the following error, attempting to cat a log file, inside a docker contain when troubleshooting another issue… TASK [setup_cassandra : shell] ************************************************* changed: [testhost] => {“changed”: true, “cmd”: “cat /var/log/cassandra/*”, “delta”: “0:00:00.004140”, “end”: “2019-03-16 18:48:28.684133”, “rc”: 0, “start”: “2019-03-16 18:48:28.679993”, “stderr”: “”, “stderr_lines”: [], “stdout”: “could not open session”, “stdout_lines”: [“could not open […]
Posted on June 14, 2017, 2:56 pm, by Rhys, under
DBA,
MongoDB.
Here’s just a quick walkthrough showing how to create a dockerized instance of a standalone MongoDB instance. First, from within a terminal, create a folder to hold the Dockerfile… mkdir Docker_MongoDB_Image cd Docker_MongoDB_Image touch Dockerfile Edit the Dockerfile… vi Dockerfile Enter the following text. You may wish to modify the file slightly. For example; if […]