Open am97 opened 2 months ago
Thanks a ton for contributing!
I'll be honest, we don't really use the docker file anywhere in production currently, but it's a fantastic idea to keep this updated to help others use cases or just to make sure information is easily shared to others attempting to setup Pulsar.
So I'll do my best to take a look into this PR soon, and confirm that everything matches how it should.
Thanks ! My use case is to make a local build without installing all the dev tools directly on my system, so I updated the Dockerfile while working on my other PR.
I realized that since a non-root user is used now, there should be a way to configure it's UID/GID, I'll add that
The steps to build Pulsar using Docker would be now:
docker build --build-arg "PUID=$(id -u)" --build-arg "PGID=$(id -g)" -t pulsar-dev
(the UID/GID of the current user will be used for the pulsar
user inside the container, so that it can read/write bind mounts)docker run --rm -it -v $PWD:/repo -w /repo pulsar-dev
yarn install
yarn build
yarn build:apm
yarn dist appimage
yarn dist deb
yarn dist rpm
yarn dist targz
I also realized that yarn start
doesn't work inside the container, as that requires a GUI. It's possible, but non-trivial to share the host GUI with the container (see for example https://stackoverflow.com/a/25280523).
Even without a working yarn start
, it would still be useful to be able to build Pulsar with Docker, for people making just small changes / fixing bugs
Tests
After cloning the pulsar repo and updating submodules, I run the image with
docker run --rm -it -v /path/to/pulsar:/repo -w /repo my_image
. The following commands are working correctly inside the image:yarn install
yarn build
yarn build:apm
yarn dist appimage
yarn dist deb
yarn dist rpm
yarn dist targz