Skip to content

Comments

Add Thrift 0.12#16

Merged
ahawkins merged 3 commits intoahawkins:masterfrom
yuokada:feature/0.12
Feb 6, 2019
Merged

Add Thrift 0.12#16
ahawkins merged 3 commits intoahawkins:masterfrom
yuokada:feature/0.12

Conversation

@yuokada
Copy link
Contributor

@yuokada yuokada commented Dec 29, 2018

Overview

  • Bump version to 0.12.0
  • Fetch source file from github.com
  • Use base image "ubuntu:18.04"

Resolve #17

@yuokada
Copy link
Contributor Author

yuokada commented Dec 29, 2018

@ahawkins Could you check this PR?

@jeking3
Copy link
Contributor

jeking3 commented Jan 22, 2019

If you could tell me what the desired artifacts are for this container, I can probably help you optimize it down to something smaller. For example if all you need is the thrift compiler then you can further tune the build just to build the compiler.

@yuokada
Copy link
Contributor Author

yuokada commented Jan 23, 2019

For example if all you need is the thrift compiler then you can further tune the build just to build the compiler.

Yes, I need thrift command only.
Could you tell me how to reduce image size?

@jeking3
Copy link
Contributor

jeking3 commented Jan 23, 2019

Try --disable-libs as part of the configure arguments. This will limit the build to just the compiler, I believe.

The Apache Thrift project is considering adding a Dockerfile to the project that will provide /usr/bin/thrift similar to what is done here, and making it available on apache/thrift in docker hub.

0.12/Dockerfile Outdated
&& make install \
&& cd / \
&& rm -rf /usr/src/thrift \
&& curl -k -sSL "https://storage.googleapis.com/golang/go1.4.linux-amd64.tar.gz" -o go.tar.gz \
Copy link
Contributor

Choose a reason for hiding this comment

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

Apache Thrift 0.12.0 supports go 1.7 or later, I believe... what is go 1.4 doing in this repo if the goal is to provide a compiler? All that's needed is C++ for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line is copied from 0.11/Dockerfile.
There is no reason no more.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove go from the container, and you may be able to remove most of the "buildDeps" that were installed in order to build the compiler.

0.12/Dockerfile Outdated
&& rm go.tar.gz \
&& cp go/bin/gofmt /usr/bin/gofmt \
&& rm -rf go \
&& apt-get purge -y --auto-remove $buildDeps
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also add:

# Clean up
RUN rm -rf /var/cache/apt/* && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /tmp/* && \
    rm -rf /var/tmp/*

To clean up apt caches and other temporary stuff.

@@ -0,0 +1,41 @@
FROM ubuntu:18.04
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a large image to start from. Why not use buildpack-deps:bionic-scm ?

Copy link
Contributor Author

@yuokada yuokada Jan 23, 2019

Choose a reason for hiding this comment

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

A image using buildpack-deps is bigger than using ubuntu.

$ sudo docker images
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
tmp2                       latest              d1cc5d0e893c        10 seconds ago      317 MB  # <= FROM buildpack-deps
tmp                        latest              2ca50fa19b8a        5 minutes ago       151.9 MB   #  <= FROM ubuntu:18.04
docker.io/ubuntu           18.04               20bb25d32758        6 hours ago         87.47 MB
docker.io/buildpack-deps   bionic-scm          4b15e4cfafaf        3 weeks ago         247.9 MB

Copy link
Contributor

Choose a reason for hiding this comment

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

I see - my mistake.

&& rm -rf go \
&& apt-get purge -y --auto-remove $buildDeps

CMD [ "thrift" ]
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better if this container did not run thrift as root.

There's a good recipe for running inside a container as a regular user in the Boost Docker Development Environment.

Copy link
Contributor

@jeking3 jeking3 left a comment

Choose a reason for hiding this comment

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

I see a number of things that can be optimized and secured here...

@jeking3
Copy link
Contributor

jeking3 commented Jan 24, 2019

Shouldn't there be CI here?

Co-Authored-By: yuokada <callistoiv+git@gmail.com>
@yuokada
Copy link
Contributor Author

yuokada commented Jan 24, 2019

CI is repository owner task.

@ahawkins Could you tell me your policy?

@jpkrohling
Copy link

jpkrohling commented Feb 6, 2019

@ahawkins , are you able to review/merge this fix? We could really use 0.12 in the Jaeger build, but we are blocked by this issue here.

@ahawkins ahawkins changed the title Add Docker 0.12 Add Thrift 0.12 Feb 6, 2019
@ahawkins ahawkins merged commit d7e7387 into ahawkins:master Feb 6, 2019
@ahawkins
Copy link
Owner

ahawkins commented Feb 6, 2019

@yuokada Thanks for the PR. Sorry for the delay.

Shouldn't there be CI here?

Yup there should be. I need to add something.

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.

4 participants