Skip to content

Several small tweaks/fixes for contrib/mkimage-debian.sh#1883

Merged
tianon merged 1 commit intomoby:masterfrom
tianon:mkimage-debian
Sep 24, 2013
Merged

Several small tweaks/fixes for contrib/mkimage-debian.sh#1883
tianon merged 1 commit intomoby:masterfrom
tianon:mkimage-debian

Conversation

@tianon
Copy link
Member

@tianon tianon commented Sep 14, 2013

I decided it was time to workaround #1755 in the mkimage-debian.sh script, so I figured out a simple fix. Now we just let docker import tag the image directly, and we don't care about the actual image hash, since docker tag lets us use repo:tag in place of the image hash to just tag an existing tag elsewhere, and that works swell for our purposes here.

While I was there (and since @shykes and I were discussing it on IRC), I added the /usr/sbin/policy-rc.d mentioned in #446 by default, since the vast majority of docker users are surprised when they apt-get install or apt-get upgrade and services fail to start and that sometimes makes the install fail. Users who specifically run with /sbin/init can then delete that file, instead of the rest of us having to add it, which makes a lot of sense.

Finally, I also added apt-get clean right before we import so that we get smaller images (since the basic idea of this script is to create base images), and on wheezy I went from ~157.5MB down to ~120MB, which I think is a worthwhile decrease.

cc @KSid

@tianon
Copy link
Member Author

tianon commented Sep 14, 2013

For what it's worth, I've successfully updated both tianon/debian and tianon/debian-roll on the index with these changes (all three active tags of each repo).

@jpetazzo
Copy link
Contributor

Nice. Bonus points for teaching me about $'.....' to interpret -escaped
special chars!

Do we want to add those hacks too? (Not mandatory, but hey, while we're
giving this some attention...)

this forces dpkg not to call sync() after package extraction and

speeds up install
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup

we don't need and apt cache in a container

RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache

@tianon
Copy link
Member Author

tianon commented Sep 14, 2013

Sounds great to me; new commit pending!

@tianon
Copy link
Member Author

tianon commented Sep 17, 2013

Currently, this script handles ubuntu surprisingly well also (./mkimage-debian.sh tianon/ubuntu precise, for example works very well and results in a ~97.27MB image), but the automagic scripted tagging is obviously geared very much towards debian. I'm thinking of expanding to add more "magic tagging" for ubuntu as well. Should I said changes directly here and get it all in together, or wait for this to be merged and submit another pull afterwards?

@jpetazzo
Copy link
Contributor

As far as I'm concerned, do whatever you're the most comfortable with!

@creack
Copy link
Contributor

creack commented Sep 19, 2013

LGTM, /cc @mzdaniel @jpetazzo

@jpetazzo
Copy link
Contributor

LGTM.

@KSid
Copy link
Contributor

KSid commented Sep 19, 2013

This looks great @tianon!

@tianon
Copy link
Member Author

tianon commented Sep 20, 2013

Cool, then it looks like this one is ready for merge. I'm happy to squash, if that's desired.

I'll submit my ideas for better ubuntu tagging in a later pull, since I haven't fleshed them out completely yet and it appears that we've got enough agreement for this to go in now.

@tianon
Copy link
Member Author

tianon commented Sep 24, 2013

I've just squashed and rebased this so that it can be merged and keep cleaner release changelogs. Is there anything necessary left before we merge?

Add simple workaround for moby#1755 to contrib/mkimage-debian.sh

Add simple echo patch in contrib/mkimage-debian.sh to prevent init scripts from running during apt-get installs/updates

Add `apt-get clean` to mkimage-debian.sh for slightly smaller images

Add more small apt tweaks to mkimage-debian.sh thanks to @jpetazzo and @spahl
@crosbymichael
Copy link
Contributor

LGTM

tianon added a commit that referenced this pull request Sep 24, 2013
Several small tweaks/fixes for contrib/mkimage-debian.sh
@tianon tianon merged commit d6887b7 into moby:master Sep 24, 2013
@tianon tianon deleted the mkimage-debian branch September 24, 2013 05:44
vieux added a commit that referenced this pull request Jan 25, 2017
Cherry pick docker #30145 and vendor corresponding swarmkit #1883
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

Successfully merging this pull request may close these issues.

5 participants