Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default dockerfile template adds additional size to image. #292

Open
m2dc0d3r opened this issue Apr 9, 2018 · 0 comments
Open

Default dockerfile template adds additional size to image. #292

m2dc0d3r opened this issue Apr 9, 2018 · 0 comments

Comments

@m2dc0d3r
Copy link

m2dc0d3r commented Apr 9, 2018

I'm not sure this issue has been already reported but there are some parts in docker.rb that needs a change.
https://github.com/test-kitchen/kitchen-docker/blob/master/lib/kitchen/driver/docker.rb
there are RUN commands to install openssh-server and some additional tools.
in the end there always should be a command to clear up the package manager cache.
For example:
when 'rhel', 'centos', 'fedora'
<<-eos
ENV container docker
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients which curl
RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
RUN [ -f "/etc/ssh/ssh_host_dsa_key" ] || ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
eos
RUN yum install -y sudo openssh-server openssh-clients which curl;yum -y clean all
This i a run without yum cache clean:
IMAGE CREATED CREATED BY SIZE COMMENT
88057ecdce48 5 minutes ago /bin/sh -c echo ssh-rsa\ AAAAB3NzaC1yc2EAAAA… 400B
0b219bed0d9f 5 minutes ago /bin/sh -c yum -y install net-tools iproute … 27.3MB
3a1ee7b87743 5 minutes ago /bin/sh -c chmod 0600 /home/kitchen/.ssh/aut… 0B
579e3edae0ec 5 minutes ago /bin/sh -c chown kitchen /home/kitchen/.ssh/… 0B
ac6eb1169c96 5 minutes ago /bin/sh -c touch /home/kitchen/.ssh/authoriz… 0B
211d693a52a8 5 minutes ago /bin/sh -c chmod 0700 /home/kitchen/.ssh 0B
b5e303c0d289 5 minutes ago /bin/sh -c chown -R kitchen /home/kitchen/.s… 0B
d1b2bd9ef6d1 5 minutes ago /bin/sh -c mkdir -p /home/kitchen/.ssh 0B
d081ad9852f8 5 minutes ago /bin/sh -c echo "Defaults !requiretty" >> /e… 3.99kB
6f3e8bfcfa64 5 minutes ago /bin/sh -c echo "kitchen ALL=(ALL) NOPASSWD:… 3.97kB
5fb86ccb0833 5 minutes ago /bin/sh -c if ! getent passwd kitchen; then … 296kB
113b6affb75e 5 minutes ago /bin/sh -c ssh-keygen -t dsa -f /etc/ssh/ssh… 1.27kB
a87096f2f61d 5 minutes ago /bin/sh -c ssh-keygen -t rsa -f /etc/ssh/ssh… 2.07kB
8bda0cd3ce2e 5 minutes ago /bin/sh -c yum install -y sudo openssh-serve… 109MB
dc1a8eb0af0d 5 minutes ago /bin/sh -c yum clean all 20MB
81f2ddcf99c6 5 minutes ago /bin/sh -c #(nop) ENV container=docker 0B
41f13a9d177b 5 minutes ago /bin/sh -c #(nop) ENV NO_PROXY=10.,.int.kn 0B
de177e2ee788 5 minutes ago /bin/sh -c #(nop) ENV no_proxy=10.,.int.kn 0B
34e56626ac71 5 minutes ago /bin/sh -c #(nop) ENV HTTPS_PROXY=http://zs… 0B
813f933df96b 5 minutes ago /bin/sh -c #(nop) ENV https_proxy=http://zs… 0B
65bd1b2d35ae 5 minutes ago /bin/sh -c #(nop) ENV HTTP_PROXY=http://zsc… 0B
670212484412 5 minutes ago /bin/sh -c #(nop) ENV http_proxy=http://zsc… 0B
e934aafc2206 2 days ago /bin/sh -c #(nop) CMD ["/bin/bash"] 0B
2 days ago /bin/sh -c #(nop) LABEL org.label-schema.sc… 0B
2 days ago /bin/sh -c #(nop) ADD file:f755805244a649ecc… 199MB

Notice:
8bda0cd3ce2e 5 minutes ago /bin/sh -c yum install -y sudo openssh-serve… 109MB

And now run with yum cleanup command added:
IMAGE CREATED CREATED BY SIZE COMMENT
11ec235dda61 5 minutes ago /bin/sh -c echo ssh-rsa\ AAAAB3NzaC1yc2EAAAA… 400B
985e8b319e00 5 minutes ago /bin/sh -c yum -y install net-tools iproute … 27.3MB
ceda4f7b03c2 5 minutes ago /bin/sh -c chmod 0600 /home/kitchen/.ssh/aut… 0B
2d63fe7ab0e6 5 minutes ago /bin/sh -c chown kitchen /home/kitchen/.ssh/… 0B
4cb8d0131c8b 5 minutes ago /bin/sh -c touch /home/kitchen/.ssh/authoriz… 0B
324f1ea6b999 5 minutes ago /bin/sh -c chmod 0700 /home/kitchen/.ssh 0B
9980d4510c48 5 minutes ago /bin/sh -c chown -R kitchen /home/kitchen/.s… 0B
333a80b25231 5 minutes ago /bin/sh -c mkdir -p /home/kitchen/.ssh 0B
9c2e827abce5 5 minutes ago /bin/sh -c echo "Defaults !requiretty" >> /e… 3.99kB
f9d6f324d152 5 minutes ago /bin/sh -c echo "kitchen ALL=(ALL) NOPASSWD:… 3.97kB
89b2e32c633a 5 minutes ago /bin/sh -c if ! getent passwd kitchen; then … 296kB
1e2967d3d39a 5 minutes ago /bin/sh -c ssh-keygen -t dsa -f /etc/ssh/ssh… 1.27kB
6c5ac65c1085 5 minutes ago /bin/sh -c ssh-keygen -t rsa -f /etc/ssh/ssh… 2.07kB
b9ef9d8268ac 5 minutes ago /bin/sh -c yum install -y sudo openssh-serve… 26.7MB
a7b08ac5fd74 6 minutes ago /bin/sh -c yum clean all 20MB
a2a38e12d4cc 6 minutes ago /bin/sh -c #(nop) ENV container=docker 0B
04ee3bc15718 6 minutes ago /bin/sh -c #(nop) ENV NO_PROXY=10.,.int.kn 0B
ab01426f677e 6 minutes ago /bin/sh -c #(nop) ENV no_proxy=10.,.int.kn 0B
df32795d1fc0 6 minutes ago /bin/sh -c #(nop) ENV HTTPS_PROXY=http://zs… 0B
c64b769e5b39 6 minutes ago /bin/sh -c #(nop) ENV https_proxy=http://zs… 0B
efb346c05479 6 minutes ago /bin/sh -c #(nop) ENV HTTP_PROXY=http://zsc… 0B
1f3b74931e63 6 minutes ago /bin/sh -c #(nop) ENV http_proxy=http://zsc… 0B
e934aafc2206 2 days ago /bin/sh -c #(nop) CMD ["/bin/bash"] 0B
2 days ago /bin/sh -c #(nop) LABEL org.label-schema.sc… 0B
2 days ago /bin/sh -c #(nop) ADD file:f755805244a649ecc… 199MB

Notice:
b9ef9d8268ac 5 minutes ago /bin/sh -c yum install -y sudo openssh-serve… 26.7MB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant