tilemill icon indicating copy to clipboard operation
tilemill copied to clipboard

Create Docker for Tilemill releases

Open csytsma opened this issue 4 years ago • 16 comments

Goal: Create a Docker image for Tilemill that works for Ubuntu, MacOS and Windows. This will help with new users to be able to easily setup and start using Tilemill.

Do we have any takers that can help create the Docker image, and add it to the repo?

csytsma avatar Jun 13 '21 18:06 csytsma

Working on this. Once I have something actually usable, I'll come back here and figure out what the best way to contribute it will be.

apbarratt avatar Jun 13 '21 22:06 apbarratt

I should probably point out that whilst I was aiming to make it reusable, it was really just a personal project so will likely need some one to fork it to make it a little more polished for sharing around =D

apbarratt avatar Jun 13 '21 23:06 apbarratt

@apbarratt This will be great. I have some co-workers that are big Docker users, so I'm sure I can get one of them to help "productionize" anything you create.

csytsma avatar Jun 14 '21 00:06 csytsma

Have we a discord server anywhere for when I have quicky questions to ask? :)

apbarratt avatar Jun 14 '21 08:06 apbarratt

We don't. I've thought about setting up a Slack instance. I'd prefer Slack over discord. Would that work?

csytsma avatar Jun 14 '21 16:06 csytsma

@apbarratt Take a look at #2736, the Dockerfile may have already been created by someone.

csytsma avatar Jun 14 '21 16:06 csytsma

Oh yes, there's a few of them around. But I'm wanting something a little friendlier. Something that'll just host the lot of port 80 and have the database and OSM-bright etc already there, ready to go. It's the last bit I'm finding tricky.

apbarratt avatar Jun 14 '21 16:06 apbarratt

Here's the basic tilemill anyway. All runs using port 80, so once it's running, you can just have it loaded up by going to localhost in your browser. https://github.com/apbarratt/docker_tilemill

apbarratt avatar Jun 14 '21 17:06 apbarratt

Thanks @apbarratt for your work! I am currently trying to reduce the overall image size and to create a version that will also work with podman. As one migh have guessed, the change to alpine is not straightforward and maybe someone can help me out here.

Out of the box, one runs into linker issues:

Error: Error relocating /tilemill/node_modules/gdal/lib/binding/node-v57-linux-x64/gdal.node: __printf_chk: symbol not found

which can/should be solved when building gdal explicitly with shared libs npm install gdal --build-from-source --shared_gdal

Which would install the most up to date version and that relies on node v 10++ Use of a specific version npm install [email protected] --build-from-source --shared_gdal only leads to futher compile errors with gyp

TypeError: write() argument must be str, not bytes while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Linux 5.13.15-100.fc33.x86_64 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/tilemill/node_modules/mapnik/lib/binding/mapnik.node" "--module_name=mapnik" "--module_path=/tilemill/node_modules/mapnik/lib/binding" gyp ERR! cwd /tilemill/node_modules/mapnik gyp ERR! node -v v8.17.0 gyp ERR! node-gyp -v v5.0.5 gyp ERR! not ok

Since I am lacking experience with the whole node dependency stack, can someone point me into the right direction? Thx

Stoiker avatar Sep 17 '21 08:09 Stoiker

@csytsma Regarding your question about Slack from 15 June. That would be helpful at least for me

xycarto avatar Sep 30 '21 20:09 xycarto

Just to let you know, I dumped the alpine approach and settled for a two stage build with node and node-slim images. PR can be found here: https://github.com/tilemill-project/tilemill/pull/2748

Also, could someone verify if this setup is working for them as well? I tested it with Docker under Ubuntu 20.04.03 in a VM.

Stoiker avatar Oct 07 '21 13:10 Stoiker

I set up and tested this on Ubuntu 20.04. No VM.

Did as suggested in README:

git clone https://github.com/tilemill-project/tilemill.git
cd tilemill
docker-compose up

No issues. Runs great. Connections to my PostgreSQL databases work as expected.

Great job

xycarto avatar Dec 16 '21 03:12 xycarto

@xycarto great! Thx for testing!

Stoiker avatar Dec 16 '21 18:12 Stoiker

Tested on Mac apple silicon. It shows error when running docker-compose Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/src/app/node_modules/mapnik/lib/binding/mapnik.node --module_name=mapnik --module_path=/usr/src/app/node_modules/mapnik/lib/binding' (1)

SaidAlSouti avatar Mar 24 '22 07:03 SaidAlSouti

Hi @SaidAlSouti thx for your comment. Sadly, I don't own an apple silicon based device, hence I can not verify this issue. Can you post more output (if there is anything meaningful regarding the mapnik issue)?

Stoiker avatar Mar 24 '22 20:03 Stoiker

PR #2758 was created to fix Apple M1 issue, hoping someone on this thread can test and verify the fix.

csytsma avatar Aug 25 '22 16:08 csytsma