What is the role of 'pause' container?

Skip to first unread message

ye yin

Sep 25, 2014, 4:09:53 AM9/25/14
to google-c...@googlegroups.com
# docker ps
CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS              PORTS                NAMES
f068e113a223        fedora/apache:latest      /run-apache.sh      6 minutes ago       Up 6 minutes                             k8s--master.46f38828--apache.etcd--40d44434_-_447f_-_11e4_-_a78a_-_0016e49ab56a--26c69622   
ae59aa47694d        kubernetes/pause:latest   /pause              51 minutes ago      Up 51 minutes>80/tcp   k8s--net.eb9b7c7c--apache.etcd--40d44434_-_447f_-_11e4_-_a78a_-_0016e49ab56a--37d11f9d  

When I start fedora/apache, the 'pause' started at first, and map the port. Why introduce 'pause' container?

Eric Paris

Sep 25, 2014, 8:35:48 AM9/25/14
to google-c...@googlegroups.com
The pause container is a container which holds the network namespace
for the pod. It does nothing 'useful'. (It's actually just a little
bit of assembly that goes to sleep and never wakes up)

This means that your 'apache' container can die, and come back to
life, and all of the network setup will still be there. Normally if
the last process in a network namespace dies the namespace would be
destroyed and creating a new apache container would require creating
all new network setup. With pause, you'll always have that one last
thing in the namespace.

I'd suggest thinking of it as an implementation detail you just ignore.
> --
> You received this message because you are subscribed to the Google Groups
> "Containers at Google" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-contain...@googlegroups.com.
> To post to this group, send email to google-c...@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-containers.
> For more options, visit https://groups.google.com/d/optout.

Ye Yin

Sep 25, 2014, 11:58:25 AM9/25/14
to google-c...@googlegroups.com

在 2014年9月25日星期四UTC+8下午8时35分48秒,Eric Paris写道:
Reply all
Reply to author
0 new messages