Open barbiedrummer opened 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.
@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).
@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
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
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.
Any news?
@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.
Any updates?
It's 2024 now, asking for any update?
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)
@pmwkaa @reshke @x4m Could you please provide some feedback on this?
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.
It will be very useful for beginners to give an official docker image. It also can be used as a tutorial for installation.