Now image builds murmur from the source code instead of using official static binary. Static linking is unavailable in the current release.

This commit is contained in:
Alexey Skobkin 2022-01-20 03:35:11 +03:00
parent d1a5399e2a
commit 46e417162a
4 changed files with 88 additions and 21 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/.idea

45
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,45 @@
stages:
- build
- push
variables:
BUILT_IMAGE_TAG: built_image
IMAGE_TAG: $CI_REGISTRY_IMAGE
DOCKER_HUB_IMAGE_TAG: "skobkin/murmur:latest"
DOCKER_HUB_LOGIN: skobkin
DOCKER_HUB_TOKEN: "xxx"
build:
image: docker:19.03.12
services:
- docker:19.03.12-dind
stage: build
script:
- docker build -t $BUILT_IMAGE_TAG .
- docker save -o $CI_PROJECT_DIR/images.tar $BUILT_IMAGE_TAG
artifacts:
paths:
- images.tar
push-gitlab-registry:
image: docker:19.03.12
services:
- docker:19.03.12-dind
stage: push
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker load -i images.tar
- docker tag $BUILT_IMAGE_TAG $IMAGE_TAG
- docker push $IMAGE_TAG
push-docker-hub-registry:
image: docker:19.03.12
services:
- docker:19.03.12-dind
stage: push
script:
- docker login -u $DOCKER_HUB_LOGIN -p $DOCKER_HUB_TOKEN
- docker load -i images.tar
- docker tag $BUILT_IMAGE_TAG $DOCKER_HUB_IMAGE_TAG
- docker push $DOCKER_HUB_IMAGE_TAG

View file

@ -1,32 +1,53 @@
FROM alpine:3
FROM alpine:3 as builder
ARG VERSION
ARG VERSION=1.4.230
LABEL \
org.label-schema.vendor="Alexey Skobkin - skobkin-ru@ya.ru" \
org.label-schema.url="https://bitbucket.org/skobkin/docker-murmur-official-static-image/" \
org.label-schema.name="Murmur Server (official static 32-bit build)" \
org.label-schema.url="https://gitlab.com/skobkin/docker-murmur" \
org.label-schema.name="Murmur Server" \
org.label-schema.version=$VERSION \
org.label-schema.vcs-url="https://skobkin@bitbucket.org/skobkin/docker-murmur-official-static-image.git" \
org.label-schema.vcs-url="https://gitlab.com/skobkin/docker-murmur.git" \
org.label-schema.license="MIT" \
org.label-schema.schema-version="1.0"
WORKDIR /opt/murmur
WORKDIR /tmp/murmur
# openssl3-dev qt5-qtsvg-dev avahi-dev git
RUN set -x \
&& apk add -q --no-cache --virtual .build-deps curl \
&& apk add -q --no-cache shadow tzdata \
&& curl -sSL https://github.com/mumble-voip/mumble/releases/download/${VERSION}/murmur-static_x86-${VERSION}.tar.bz2 -o /tmp/murmur.tar.bz2 \
&& tar -jx -f /tmp/murmur.tar.bz2 --strip-components=1 -C /opt/murmur \
&& mkdir -p /ssl \
&& mkdir -p /config \
&& mkdir -p /data \
&& rm /opt/murmur/murmur.ini \
&& apk del -q --purge .build-deps \
&& rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
apk update -q --no-cache --no-progress && \
apk add -q --no-cache --no-progress curl
RUN \
curl -sSL https://github.com/mumble-voip/mumble/releases/download/v${VERSION}/mumble-${VERSION}.tar.gz -o /tmp/mumble.tar.gz && \
tar -zxf /tmp/mumble.tar.gz --strip-components=1 -C /tmp/murmur
RUN \
apk add -q --no-cache --no-progress boost-dev build-base cmake libcap-dev protobuf-dev qt5-qtbase-dev
RUN \
cd /tmp/murmur && \
mkdir build && \
cd build && \
# static build is currently unavailable
# -Dstatic=ON
cmake -Dclient=OFF -Ddbus=OFF -Dice=OFF -Dzeroconf=OFF .. && \
make -j $(nproc)
FROM alpine:latest
RUN \
apk update -q --no-cache && \
apk add -q --no-cache libcap libcrypto1.1 libgcc libprotobuf libssl1.1 libstdc++ musl qt5-qtbase qt5-qtbase-sqlite \
shadow tzdata && \
mkdir -p /ssl && \
mkdir -p /config && \
mkdir -p /data
COPY --from=builder /tmp/murmur/build/mumble-server /bin/mumble-server
EXPOSE 64738/tcp 64738/udp
VOLUME ["/config", "/data", "/ssl"]
ENTRYPOINT ["/opt/murmur/murmur.x86", "-ini", "/config/murmur.ini", "-v", "-fg"]
ENTRYPOINT ["/bin/mumble-server", "-ini", "/config/murmur.ini", "-v", "-fg"]

View file

@ -3,16 +3,16 @@
## Build
```shell
# For version 1.3.4
docker build --build-arg VERSION=1.3.4 --tag 'skobkin/murmur-official-static:1.3.4' --tag 'skobkin/murmur-official-static:latest' .
# For version 1.4.230
docker build --build-arg VERSION=1.4.230 --tag 'skobkin/murmur:1.4.230' --tag 'skobkin/murmur:latest' .
```
## Publish
```shell
docker push skobkin/murmur-official-static:latest skobkin/murmur-official-static:1.3.4
docker push skobkin/murmur:latest skobkin/murmur:1.4.230
```
## Use
## Usage
See [skobkin/docker-stacks](https://bitbucket.org/skobkin/docker-stacks/src/master/murmur/).