-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
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
@@ -0,0 +1,8 @@ | |||
FROM python:3.6-alpine | |||
|
|||
RUN apk --no-cache add g++ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
unfortunately there is no Docker image under https://hub.docker.com/r/locustio/locust as described in the docs. |
Please add an official image for locustio on docker hub! |
I'm thinking of removing the |
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 ofpython: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.