Add ubuntu flavoured docker image of dragonfly

This commit is contained in:
Roman Gershman 2022-02-25 20:19:01 +02:00
parent a859cf2fc8
commit d1291be0b7
4 changed files with 50 additions and 4 deletions

View File

@ -25,7 +25,7 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build alpine-prod - name: Build dragonfly alpine
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
@ -33,4 +33,14 @@ jobs:
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: | tags: |
ghcr.io/${{ github.actor }}/dragonfly-alpine:latest ghcr.io/${{ github.actor }}/dragonfly-alpine:latest
file: tools/docker/Dockerfile.alpine-prod file: tools/docker/Dockerfile.alpine-prod
- name: Build dragonfly ubuntu
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/${{ github.actor }}/dragonfly-ubuntu:latest
file: tools/docker/Dockerfile.ubuntu-prod

View File

@ -23,10 +23,10 @@ RUN apk --no-cache add libgcc libstdc++ libunwind boost1.77-fiber \
RUN mkdir /data && chown dfly:dfly /data RUN mkdir /data && chown dfly:dfly /data
VOLUME /data VOLUME /data
WORKDIR /data WORKDIR /data
COPY tools/docker/alpine-entry.sh /usr/local/bin/entrypoint.sh COPY tools/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY --from=builder /build/build-opt/dragonfly /usr/local/bin/ COPY --from=builder /build/build-opt/dragonfly /usr/local/bin/
ENTRYPOINT ["entrypoint.sh"] ENTRYPOINT ["entrypoint.sh"]
EXPOSE 6380 EXPOSE 6380
CMD ["dragonfly"] CMD ["dragonfly", "--logtostderr"]

View File

@ -0,0 +1,36 @@
# syntax=docker/dockerfile:1
from ghcr.io/romange/ubuntu-dev as builder
WORKDIR /build
COPY src/ ./src/
COPY helio/ ./helio/
COPY patches/ ./patches/
COPY CMakeLists.txt ./
RUN ./helio/blaze.sh -release
WORKDIR build-opt
RUN ninja dragonfly
RUN curl -O https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c && \
gcc -Wall -O2 su-exec.c -o su-exec
FROM ubuntu:20.04
LABEL org.opencontainers.image.title Dragonfly
LABEL org.opencontainers.image.source https://github.com/romange/dragonfly
ENV DEBIAN_FRONTEND=noninteractive
RUN groupadd -r -g 999 dfly && useradd -r -g dfly -u 999 dfly
RUN apt update && apt install -y libunwind8 libboost-fiber1.71.0 libssl1.1 && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /data && chown dfly:dfly /data
VOLUME /data
WORKDIR /data
COPY tools/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY --from=builder /build/build-opt/dragonfly /usr/local/bin/
COPY --from=builder /build/build-opt/su-exec /usr/local/bin/
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 6380
CMD ["dragonfly", "--logtostderr"]