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

Use tini in Docker images. #320

Merged
merged 1 commit into from
May 31, 2017
Merged

Use tini in Docker images. #320

merged 1 commit into from
May 31, 2017

Conversation

mccheah
Copy link

@mccheah mccheah commented May 31, 2017

Closes #317.

Copy link

@ash211 ash211 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- @foxish did you have any questions about this since you were asking about it during the weekly video call today?

@foxish
Copy link
Member

foxish commented May 31, 2017

@tnachen PTAL

@erikerlandson
Copy link
Member

Is there a reason it's using tini as an entrypoint in some, but exec /sbin/tini ... in others?

@mccheah
Copy link
Author

mccheah commented May 31, 2017

The exec ones have to do more complex bash environment variable substitution at execution time, so those more comfortably fit in the exec form of the Docker command. It would be good to unify these, but for another time.

@erikerlandson
Copy link
Member

This is a bit tangential and not a bug, but multiple RUN statements can be combined to reduce the number of image layers:

RUN apk upgrade --update
RUN apk add --update bash tini
RUN mkdir -p /opt/spark
RUN touch /opt/spark/RELEASE

Can be combined like:

RUN apk upgrade --update && \
    apk add --update bash tini && \
    mkdir -p /opt/spark && \
    touch /opt/spark/RELEASE

@ash211
Copy link

ash211 commented May 31, 2017

@erikerlandson what are the advantages to having fewer image layers?

@tnachen
Copy link

tnachen commented May 31, 2017

LGTM, but I also suggest having few layers. It's generally a best practice to have fewer layers, as the more layers you have the more work registry/daemon/client will have to do to download and manage.
Also depending on the filesystem you end up using with Docker, fewer layers could also help performance as some filesystems requires copying and traversing layers on writes/reads.

@erikerlandson
Copy link
Member

Another potential benefit to consolidated RUN is you can do file cleanup in the same layer, which is another way to decrease image size. This post describes some examples:

https://blog.codeship.com/reduce-docker-image-size/

I don't quite follow the exec distinction, but I have no doubt it solves the pid problem either way.

@ash211
Copy link

ash211 commented May 31, 2017

Let's squash those layers in a separate PR -- it definitely sounds like a good idea and I don't see a downside to it.

#323

@ash211 ash211 merged commit 9be8f20 into branch-2.1-kubernetes May 31, 2017
@ash211 ash211 deleted the add-tini branch May 31, 2017 22:01
foxish pushed a commit that referenced this pull request Jul 24, 2017
ifilonenko pushed a commit to ifilonenko/spark that referenced this pull request Feb 26, 2019
puneetloya pushed a commit to puneetloya/spark that referenced this pull request Mar 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants