rwynn / monstache

a go daemon that syncs MongoDB to Elasticsearch in realtime. you know, for search.
https://rwynn.github.io/monstache-site/
MIT License
1.29k stars 182 forks source link

Repositories/ Dockerfiles for monstache base images #727

Closed vipulg13 closed 5 months ago

vipulg13 commented 5 months ago

Dear @rwynn, could you please provide me with the Dockerfiles for the base images rwynn/monstache-alpine and rwynn/monstache-builder-cache-rel6, used for the final monstache build? Due to my institute's internal security policies, I must use the updated alpine and golang images in my build.

Joey0538 commented 5 months ago

Instead of rwynn/monstache-builder-cache-rel6, you can simply use latest golang alpine images from dockerhub and add this to the dockerfile:

FROM golang:<alpine-latest-tag> As build
RUN apk add --no-cache gcc musl-dev

COPY monstache code and plugin and build using this image

Instead of rwynn/monstache-alpine, you some latest alpine image from dockerhub and:

FROM <alpine_latest_image>as final

COPY --from=build /app/build/linux-amd64/monstache /bin/monstache
COPY --from=build /app/build/plugin.so /bin/plugin.so`

and update the go.mod to use the same go version as that of your golang docker image in your source code.

vipulg13 commented 5 months ago

@Joey0538 thank you for your comments. I was aware of this builder Dockerfile, but I was not sure whether that is up to date. My multi-stage custom build was successful.