Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
2 deleted 41 characters in body
source | link

I am trying to understand how linux containers work internally. One of the things that I have learned is that you can containerize a shell by passing in special flags to it. Out of the flags one is for the PIDs.

This however, does not give the desired effect for the ps command, as it still shows all the processes from the host and the container. This is probably because ps reads from /proc directory.

One of the methods I have seen to get ps to show processes that are running only on the container is via chrooting into a fake root file system (which just contains the directories/utilities of the operating system) and then mounting the /proc directory of the host to the proc directory of the fake fs.

I just can't understand why this actually works. Why does mounting the /proc directory into another mount point make it behave like it is containerized.

Why do you even need a fake root filesystems for containers like Docker to work properly?

Am I missing something? I am not really an expert with Linux VFS.

The technique that I describe is from this video at DockerCon.

I have set the link to the exact time this method is done.

I am trying to understand how linux containers work internally. One of the things that I have learned is that you can containerize a shell by passing in special flags to it. Out of the flags one is for the PIDs.

This however, does not give the desired effect for the ps command, as it still shows all the processes from the host and the container. This is probably because ps reads from /proc directory.

One of the methods I have seen to get ps to show processes that are running only on the container is via chrooting into a fake root file system (which just contains the directories/utilities of the operating system) and then mounting the /proc directory of the host to the proc directory of the fake fs.

I just can't understand why this actually works. Why does mounting the /proc directory into another mount point make it behave like it is containerized.

Why do you even need a fake root filesystems for containers like Docker to work properly?

Am I missing something? I am not really an expert with Linux VFS.

The technique that I describe is from this video at DockerCon.

I have set the link to the exact time this method is done.

I am trying to understand how linux containers work internally. One of the things that I have learned is that you can containerize a shell by passing in special flags to it. Out of the flags one is for the PIDs.

This however, does not give the desired effect for the ps command, as it still shows all the processes from the host and the container. This is probably because ps reads from /proc directory.

One of the methods I have seen to get ps to show processes that are running only on the container is via chrooting into a fake root file system (which just contains the directories/utilities of the operating system) and then mounting the /proc directory of the host to the proc directory of the fake fs.

I just can't understand why this actually works. Why does mounting the /proc directory into another mount point make it behave like it is containerized.

Why do you even need a fake root filesystems for containers like Docker to work properly?

Am I missing something?

The technique that I describe is from this video at DockerCon.

I have set the link to the exact time this method is done.

1
source | link

How to namespace the ps command?

I am trying to understand how linux containers work internally. One of the things that I have learned is that you can containerize a shell by passing in special flags to it. Out of the flags one is for the PIDs.

This however, does not give the desired effect for the ps command, as it still shows all the processes from the host and the container. This is probably because ps reads from /proc directory.

One of the methods I have seen to get ps to show processes that are running only on the container is via chrooting into a fake root file system (which just contains the directories/utilities of the operating system) and then mounting the /proc directory of the host to the proc directory of the fake fs.

I just can't understand why this actually works. Why does mounting the /proc directory into another mount point make it behave like it is containerized.

Why do you even need a fake root filesystems for containers like Docker to work properly?

Am I missing something? I am not really an expert with Linux VFS.

The technique that I describe is from this video at DockerCon.

I have set the link to the exact time this method is done.