Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Official Docker image and documentation V2 #882

Merged
merged 10 commits into from
Sep 21, 2018
Merged

Conversation

spayeur207
Copy link

After talking with @JDiPierro I'm taking over this initiative. However I can't actually interact with the old PR so this is being created. His original work has been rebased onto latest master.

Referencing #849

Adds a basic Dockerfile with a base of python:3.7-alpine putting final image size at 291MB.
I believe most if not all of the changes requested by @mbeacom have been addressed in this as well.

JDiPierro and others added 9 commits September 12, 2018 15:13
I've found it easier to run locust locally in standalone mode while developing the locustfile.
The example docker-compose file still exists though.
Change base image from py3.6 to py3.7-alpine. This shrinks the image size by about 600MB so that's nice.
Addition of the apk call is required for pip to actually build and of the dependencies for Locust.
Removal of docker_start portion is based on comments by mbeacom. Technically this makes the base image unusable without a consumer
adding their own Dockerfile with a COPY/ADD call or another ENTRYPOINT.
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated
@@ -0,0 +1,8 @@
FROM python:3.6-alpine

RUN apk --no-cache add g++

Choose a reason for hiding this comment

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

Please, group the build dependencies and delete their at the end of Dockerfile

Copy link
Author

Choose a reason for hiding this comment

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

Grouping build dependencies yes. Deleting them I'm not sold on.

Yes it shrinks the image by quite a bit, but it also reduces usability by others. This isn't ever supposed to be "production" grade simply due to it being a testing lib. The extra ~140MB of g++ and associated packages seems a reasonable price for facilitating the use of Locust for an audience that isn't as familiar with Docker or Alpine. Hell by that measure I should probably toss in bash and eat the extra 40MB.

Copy link

Choose a reason for hiding this comment

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

I appreciate @spayeur207's comment, but cutting the size in half would be great for those who would like to widely distribute workers. Maybe you could make it delete the build-only items, and add a note on how devs could comment-out that behavior. Then it would be nice for non-devs and (arguably) still good enough for advanced devs.

@mbeacom mbeacom merged commit 3686171 into locustio:master Sep 21, 2018
@quorak
Copy link

quorak commented Jan 15, 2019

unfortunately there is no Docker image under https://hub.docker.com/r/locustio/locust as described in the docs.
I would also suggest to use the official branch https://docs.docker.com/docker-hub/official_images/

@SBSolera
Copy link

Please add an official image for locustio on docker hub!

@heyman
Copy link
Member

heyman commented Apr 7, 2020

I'm thinking of removing the docker_start.sh shell script for Locust 1.0, in favor of just having locust as the Docker CMD. If anyone sees any problem with that please let me know in #1247.

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.

8 participants