yandex / odyssey

Scalable PostgreSQL connection pooler
BSD 3-Clause "New" or "Revised" License
3.21k stars 162 forks source link

Official docker image #29

Open barbiedrummer opened 6 years ago

barbiedrummer commented 6 years ago

It will be very useful for beginners to give an official docker image. It also can be used as a tutorial for installation.

115100 commented 6 years ago
FROM debian:stretch-slim as builder

WORKDIR /tmp/odyssey/
COPY . /tmp/odyssey/

RUN set -ex \
        && apt-get update \
        && apt-get install -y --no-install-recommends \
                build-essential \
                cmake \
                git \
                libssl-dev \
        && mkdir build \
        && cd build \
        && cmake -DCMAKE_BUILD_TYPE=Release .. \
        && make

FROM debian:stretch-slim

RUN set -ex \
        && apt-get update \
        && apt-get install -y --no-install-recommends libssl-dev \
        && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=builder /tmp/odyssey/build/sources/odyssey /usr/local/bin/
CMD ["/usr/local/bin/odyssey"]

I've got this multi-stage build working against a real database. I can open a PR if you'd like.

Unfortunately, the image is larger than I'd like due to https://github.com/yandex/odyssey/issues/26, but stretch-slim is relatively small.

barbiedrummer commented 6 years ago

@115100 thanks for example. My personal image is very similar to yours. I think it will be good to have this image ready to use in Docker Hub.

So everybody can extend it FROM odyssey:latest or simply use with docker run. docker run -v {$PWD}/odyssey.conf:/tmp/odyssey/odyssey.conf odyssey Maybe it will be also helpful to add entrypoint to use ENV variables and EXPOSE standart bouncer port 6543.

This also can be helpful because of versioning (no this repo do not use tags).

vakaobr commented 6 years ago

@115100 could you please refer which files do you have in Dockerfile dir and are copied in COPY step? Looks like I'm missing a CMakeLists.txt file

3manuek commented 6 years ago

Added an example docker-compose.yml for easy cluster setup and done other cosmetic stuff.

https://gitlab.com/3manuek/docker_images/tree/master/docker/odyssey

thedrow commented 5 years ago

This is a working alpine version:

FROM alpine as builder

RUN apk add --update cmake openssl-dev build-base git

COPY . /tmp/odyssey

WORKDIR /tmp/odyssey

RUN mkdir build

WORKDIR /tmp/odyssey/build

RUN cmake -DCMAKE_BUILD_TYPE=Release ..

RUN make -j

Naturally we need to copy the artifact to a new container. I haven't begun doing that yet.

maxpain commented 3 years ago

Any news?

x4m commented 3 years ago

@maxpain nope, sorry, not yet. We used to use docker for tests https://github.com/yandex/odyssey/tree/master/docker But it's hard to "bless" some "official" as image: no one from active contributors uses Odyssey in Docker to maintain it thoroughly.

maxpain commented 2 years ago

Any updates?

AkritW commented 1 month ago

It's 2024 now, asking for any update?

Object905 commented 1 month ago

Not official, but if anyone interested I made this Dockerfile, to be compatible with zalando-postgres operator. Can be used without it too. https://gitlab.com/Object905/zalando-odyssey

Sadly, it's slowly leaking memory (seems like because of auth_query)

maxpain commented 1 month ago

@pmwkaa @reshke @x4m Could you please provide some feedback on this?

x4m commented 1 month ago

Well, we have dockerized tests. You can do make run_test and it will be executed in Docker :) Probably, it's not what you are asking for, it's development container, not operational container.

Consider @Object905 's image blessed container :)

BTW AFAIK we fixed some leaks in auth_query. We'll do a release soon.