Skip to content

Use multi-stage build for Docker images#4184

Merged
merlimat merged 6 commits intoapache:masterfrom
merlimat:docker-size
May 18, 2019
Merged

Use multi-stage build for Docker images#4184
merlimat merged 6 commits intoapache:masterfrom
merlimat:docker-size

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

Motivation

Following from the discussion on #3602, changing the DockerFile to use multi-stage build.

This avoids having the Pulsar tgz to be included twice in the image (because of the mv /apache-pulsar-2.x.y /pulsar).

The image size goes from 1G to < 400MB.

@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Apr 30, 2019
@merlimat merlimat added this to the 2.4.0 milestone Apr 30, 2019
@merlimat merlimat self-assigned this Apr 30, 2019
@merlimat merlimat removed the request for review from asfsecurity April 30, 2019 19:56
@aahmed-se
Copy link
Copy Markdown
Contributor

run java8 tests

@aahmed-se
Copy link
Copy Markdown
Contributor

run integration tests

@aahmed-se
Copy link
Copy Markdown
Contributor

something is missing

2019-05-01\T\00:45:04.560 [ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.9:build (default) on project pulsar-docker-image: Could not build image: The command '/bin/sh -c /pulsar/bin/install-pulsar-client-27.sh' returned a non-zero code: 1 -> [Help 1]
2019-05-01\T\00:45:04.565 [ERROR] 
2019-05-01\T\00:45:04.565 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
2019-05-01\T\00:45:04.565 [ERROR] Re-run Maven using the -X switch to enable full debug logging.

@aahmed-se
Copy link
Copy Markdown
Contributor

2019-05-01\T\00:44:33.170 [INFO] + pip install /pulsar/pulsar-client/pulsar_client-2.4.0-cp27-cp27mu-manylinux1_x86_64.whl
2019-05-01\T\00:44:33.170 [INFO] 
2019-05-01\T\00:44:33.804 [INFO] ERROR: pulsar_client-2.4.0-cp27-cp27mu-manylinux1_x86_64.whl is not a supported wheel on this platform.


RUN easy_install pip
RUN pip install kazoo pyyaml
RUN easy_install3 pip
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

need pip3 install kazoo pyyaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do we need both for py2 and py3?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am in favor of dropping python2. I think everything works with py3 except the dashboard.

@merlimat merlimat merged commit c509f86 into apache:master May 18, 2019
@merlimat merlimat deleted the docker-size branch May 18, 2019 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants