Skip to content

Instantly share code, notes, and snippets.

@winks
Last active April 13, 2022 14:48
Show Gist options
  • Save winks/418f2c500cde9da9d6ef0b652576fc6d to your computer and use it in GitHub Desktop.
Save winks/418f2c500cde9da9d6ef0b652576fc6d to your computer and use it in GitHub Desktop.
$ for i in $(seq 1 6); do echo $i; docker build -f Dockerfile$i -t yes$i .; done
$ docker images |grep yes
yes6 latest f9990aa719e0 5 minutes ago 239MB
yes5 latest caba2ac3b32e 7 minutes ago 239MB
yes3 latest 9436a7799b45 7 minutes ago 239MB
yes4 latest 9151f954fc08 14 minutes ago 239MB
yes1 latest fa30bf334735 24 minutes ago 239MB
yes2 latest 4fdde5e9428c 32 minutes ago 239MB
$ export xxi=1; xxid=$(docker run -d yes$xxi); echo $xxid; docker exec $xxid ps aux | grep -v 'ps' | grep -v USER; docker kill $xxid -1-
16929c7ee36a672ef225f914a2e12f7c35a909117be8d548f36d56008e8620da
root 1 0.0 0.0 23052 1376 ? Ss 14:43 0:00 /usr/bin/coreutils --coreutils-prog-shebang=yes /bin/yes
16929c7ee36a672ef225f914a2e12f7c35a909117be8d548f36d56008e8620da
$ export xxi=2; xxid=$(docker run -d yes$xxi); echo $xxid; docker exec $xxid ps aux | grep -v 'ps' | grep -v USER; docker kill $xxid
77c80c80b507eeaf687f3a14ff0e8e1dab633c3509084d98655cba8af786f86c
root 1 0.0 0.0 23052 1480 ? Ss 14:43 0:00 /usr/bin/coreutils --coreutils-prog-shebang=yes /bin/yes
77c80c80b507eeaf687f3a14ff0e8e1dab633c3509084d98655cba8af786f86c
$ export xxi=3; xxid=$(docker run -d yes$xxi); echo $xxid; docker exec $xxid ps aux | grep -v 'ps' | grep -v USER; docker kill $xxid
ec240040ad52ad4a592cb48b3c41cb3598d455d126b77889dbc820bb57bd5c02
root 1 2.0 0.0 11920 2696 ? Ss 14:43 0:00 /bin/sh /go_yes3.sh
root 7 0.0 0.0 23052 1388 ? S 14:43 0:00 /usr/bin/coreutils --coreutils-prog-shebang=yes /bin/yes
ec240040ad52ad4a592cb48b3c41cb3598d455d126b77889dbc820bb57bd5c02
$ export xxi=4; xxid=$(docker run -d yes$xxi); echo $xxid; docker exec $xxid ps aux | grep -v 'ps' | grep -v USER; docker kill $xxid
44a99c9d83c8540d13b5f09d7d34afdd8c546c7300efc77b8346dbdec06c1b1e
root 1 0.0 0.0 11920 2728 ? Ss 14:44 0:00 /bin/sh /go_yes4.sh
root 7 0.0 0.0 23052 1504 ? S 14:44 0:00 /usr/bin/coreutils --coreutils-prog-shebang=yes /bin/yes
44a99c9d83c8540d13b5f09d7d34afdd8c546c7300efc77b8346dbdec06c1b1e
$ export xxi=5; xxid=$(docker run -d yes$xxi); echo $xxid; docker exec $xxid ps aux | grep -v 'ps' | grep -v USER; docker kill $xxid
a81a3a9c264b7986aa7af5b001ed51418ed6bfcc066609be556f74e2e46ae7ee
root 1 0.0 0.0 23052 1440 ? Ss 14:44 0:00 /usr/bin/coreutils --coreutils-prog-shebang=yes /bin/yes
a81a3a9c264b7986aa7af5b001ed51418ed6bfcc066609be556f74e2e46ae7ee
$ export xxi=6; xxid=$(docker run -d yes$xxi); echo $xxid; docker exec $xxid ps aux | grep -v 'ps' | grep -v USER; docker kill $xxid
18ceeebe227a11aabf0a0eabc52bcb84d85ab8930279a32f1cb1189a34710d1b
root 1 2.0 0.0 23052 1444 ? Ss 14:44 0:00 /usr/bin/coreutils --coreutils-prog-shebang=yes /bin/yes
18ceeebe227a11aabf0a0eabc52bcb84d85ab8930279a32f1cb1189a34710d1b
FROM redhat/ubi8
RUN yum install -y --disableplugin=subscription-manager procps
CMD /bin/yes
FROM redhat/ubi8
RUN yum install -y --disableplugin=subscription-manager procps
CMD ["/bin/yes"]
FROM redhat/ubi8
RUN yum install -y --disableplugin=subscription-manager procps
COPY go_yes3.sh /
CMD /go_yes3.sh
FROM redhat/ubi8
RUN yum install -y --disableplugin=subscription-manager procps
COPY go_yes4.sh /
CMD /go_yes4.sh
FROM redhat/ubi8
RUN yum install -y --disableplugin=subscription-manager procps
COPY go_yes5.sh /
CMD /go_yes5.sh hello
FROM redhat/ubi8
RUN yum install -y --disableplugin=subscription-manager procps
COPY go_yes6.sh /
CMD ["/go_yes6.sh","hello"]
#!/bin/sh
echo $1
/bin/yes
#!/bin/sh
echo $1
/bin/yes
#!/bin/sh
echo $1
exec /bin/yes
#!/bin/sh
echo $1
exec /bin/yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment