Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

[IMP] Switch to ash #189

Open
lasley opened this issue Dec 23, 2016 · 8 comments
Open

[IMP] Switch to ash #189

lasley opened this issue Dec 23, 2016 · 8 comments

Comments

@lasley
Copy link
Contributor

lasley commented Dec 23, 2016

I noticed that we have bash pretty engrained into the templates and whatnot. Now that we're using Alpine, we should switch up to ash instead so that we're not installing another dependency.

This ticket is for the discussion and tracking of that effort.

@amon-ra
Copy link

amon-ra commented Jan 3, 2017

Alpine use busybox and adds 900kb of memory per running instance, I propose to use dash for shell in docker images

@YannickB
Copy link
Owner

YannickB commented Jan 3, 2017

Well I think I understand why @lasley suggest ash it's the default shell in alpine. It's made for it.

Personal preference, I don't really like the user experience when I'm in the container but that's mainly because I'm too much attached to bash. No real reason then.

When we feel ready, we mainly have to remove bash from base image
https://github.com/clouder-community/clouder/blob/master/clouder/images/base/Dockerfile#L4
and change shell in execution function
https://github.com/clouder-community/clouder/blob/master/clouder/models/model.py#L571
That should do the trick.

Propose your best shell for alpine use and let's vote.

@lasley
Copy link
Contributor Author

lasley commented Jan 3, 2017

Yeah the only reason I proposed ash is because it's included. It's actually quite limited - such as lacking arrays. My vote is still on it though, I'm starting to like these tiny instances.

@YannickB
Copy link
Owner

YannickB commented Jan 3, 2017

Yep, that said a shell doesn't take much space and it's something really convenient. We should vote for the best user experience, for our own sake.

For execution, I think we should use either ash or even sh, because maybe sometimes the image will not be based on alpine.

@lasley
Copy link
Contributor Author

lasley commented Jan 3, 2017

Yeah really here I was referring more to execution and not the use. You're probably right with sh in terms of compatibility though.

So we would basically just want the user shell in the ssh-exec container, right?

I like bash personally in terms of experience, but it's a bit heavy.

cc @tedsalmon

@YannickB
Copy link
Owner

YannickB commented Jan 3, 2017

Not only ssh-exec, we often connect to any kind of container through docker exec, but yeah it's the main use case.

Same for me with bash. Alpine with bash take 1.5Mo http://www.blang.io/posts/2015-04_how-to-build-the-smallest-docker-containers/, clearly not a problem (remember the 200Mo ubuntu image?).
But let's take the opportunity to consider other shell I don't know that much.

@tedsalmon
Copy link

I agree that sh would be best for cross-compatibility. bash, though heavy, makes life on the CLI much better IMO.

@lasley
Copy link
Contributor Author

lasley commented Jan 5, 2017

Hmmm ok so lack of arrays is really setting me back here. I took a look at dash too, and it seems that wouldn't provide either.

What are your thoughts? Do we have another solution for an array like structure?

The thing that's killing me is the SC2086 - Double quote to prevent globbing and word splitting Lint, which I can't totally argue with. But that makes something as simple as:

ENV BUILD_DEPS="python-dev openldap-dev"
RUN apk add --no-cache $BUILD_DEPS

turn into a real pain. Well or disabling the lint, but I honestly don't consider that an option.

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

No branches or pull requests

4 participants