Ready-to-use docker container with osmosis

I’m looking for a ready-to-use docker container with osmosis. Is there one in the public image registry somewhere?

Because I don’t really like the idea, although it’s simple and working, of a docker container like this :point_down:.

FROM debian:stable-slim
RUN apt-get update \
  && apt-get install --no-install-recommends -y osmosis \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["osmosis"]

I would like to have the lightest and most versatile container possible to run it in a containerised environment.

@Firefishy do you have any ready-made recipes for this? That would be great.

Hello

It won’t completely answer the question but you may have a look to the Docker images of Osmose here: osmose-backend/docker at dev · osm-fr/osmose-backend · GitHub

It involves osmosis and could inspire further work if it hasn’t already been done yet.

Cheers

1 Like

So far, I’ve come up with the approach of using the temurin alpine base image to integrate pre-build osmosis.

FROM eclipse-temurin:24.0.1_9-jre-alpine-3.21

ENV OSMOSIS_HOME=/opt/osmosis

COPY osmosis ${OSMOSIS_HOME}

# Make osmosis executable and create symlink
RUN chmod +x ${OSMOSIS_HOME}/bin/osmosis && \
    ln -s ${OSMOSIS_HOME}/bin/osmosis /usr/local/bin/osmosis

# Set entrypoint
ENTRYPOINT ["osmosis"]

This approach allows you to get a docker image with minimal footprint. Now I just need to create a CI/CD pipeline to build the image and publish it to the Docker Hub and ghcr.io for public use.

PS In case you know of an even more compact base image for working with java applications, please let me know.

1 Like

I found the way how to shrink size of the image by 3x. More updates to come.

I’m happy to announce that the pipeline for creating an osmosis docker image is ready. The image is based on eclipse-temurin:24.0.1_9-jre-alpine-3.21 with the latest available stable osmosis build 0.49.2. It is a multi-architecture image with support for linux/amd64 and linux/arm64 architectures.

The images are available for download:

The code for the pipeline itself is available on GitHub: GitHub - Andygol/osmosis-docker: Osmosis is a command line Java application for processing OpenStreetMap data.

PS. Further contributions to improve and reduce the footprint of the current image are welcome.

1 Like