Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

is not posible to build docker ejabberd ecs on MacOS ?

Đang mở
#124 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
docker, elixir, erlang, go, shell
Lĩnh vực
build-system, devops

Hướng nghiên cứu

The failure occurs in Dockerfile line 19 during mix deps.get, after the git checkout; start by reviewing build.sh and comparing the docker build --platform linux/amd64 invocation on macOS with the successful Ubuntu build. Check the docker.io/ejabberd/mix image and the reported Elixir, Mix, and Hex versions. Done means build.sh completes and produces ejabberd/ecs:25.03 on macOS.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

hi

i tried to build ecs on my Mac

i wrote

sudo ./build.sh 25.03

this is my build.sh

#!/bin/sh

current=$(date +%y.%m)
version=${1:-$current}

docker build \
    --build-arg VERSION=$version \
    --build-arg VCS_REF=`git rev-parse --short HEAD` \
    --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
    -t ejabberd/ecs:$version --platform linux/amd64  .

[ "$version" = "latest" ] || docker tag ejabberd/ecs:$version ejabberd/ecs:latest

i got this error message

11:50:23.723 [notice] Application hex exited: exited in: Hex.Application.start(:normal, [])
10.95     ** (EXIT) an exception was raised:
10.95         ** (MatchError) no match of right hand side value: 105
10.95             (elixir 1.15.7) src/elixir_def.erl:134: :elixir_def.store_definition/3
10.95             (mix 1.15.7) Mix.RemoteConverger.behaviour_info/1
10.95             (kernel 9.2) application_master.erl:293: :application_master.start_it_old/4
10.97 
10.97 11:50:23.939 [notice] Application inets exited: :stopped
10.98 
10.98 11:50:23.949 [notice] Application ssl exited: :stopped
10.98 
10.98 11:50:23.949 [notice] Application public_key exited: :stopped
10.98 
10.98 11:50:23.949 [notice] Application asn1 exited: :stopped
10.99 
10.99 11:50:23.950 [notice] Application crypto exited: :stopped
11.00 Could not start Hex. Try fetching a new version with "mix local.hex" or uninstalling it with "mix archive.uninstall hex.ez"
11.01 ** (MatchError) no match of right hand side value: {:error, {:hex, {:bad_return, {{Hex.Application, :start, [:normal, []]}, {:EXIT, {{:badmatch, 105}, [{:elixir_def, :store_definition, 3, [file: ~c"src/elixir_def.erl", line: 134]}, {Mix.RemoteConverger, :behaviour_info, 1, []}, {:application_master, :start_it_old, 4, [file: ~c"application_master.erl", line: 293]}]}}}}}}
11.01     (hex 2.1.1) lib/hex.ex:5: Hex.start/0
11.01     (mix 1.15.7) lib/mix/hex.ex:60: Mix.Hex.start/0
11.01     (mix 1.15.7) lib/mix/dep/loader.ex:189: Mix.Dep.Loader.with_scm_and_app/5
11.01     (mix 1.15.7) lib/mix/dep/loader.ex:141: Mix.Dep.Loader.to_dep/4
11.01     (elixir 1.15.7) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
11.01     (mix 1.15.7) lib/mix/dep/loader.ex:364: Mix.Dep.Loader.mix_children/3
11.01     (mix 1.15.7) lib/mix/dep/loader.ex:18: Mix.Dep.Loader.children/1
11.01     (mix 1.15.7) lib/mix/dep/converger.ex:97: Mix.Dep.Converger.all/4
------

 4 warnings found (use docker --debug to expand):
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 125)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 126)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 127)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 128)
Dockerfile:19
--------------------
  18 |     COPY rel/*exs rel/
  19 | >>> RUN git checkout ${VERSION/latest/HEAD} \
  20 | >>>     \
  21 | >>>     && if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+$ ]]; then \
  22 | >>>         echo '{vsn, "'"$VERSION.0"'"}.' >> vars.config; \
  23 | >>>     else \
  24 | >>>         echo '{vsn, "0.0.0"}.' >> vars.config; \
  25 | >>>     fi \
  26 | >>>     \
  27 | >>>     && mix deps.get \
  28 | >>>     && (cd deps/eimp; ./configure)
  29 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c git checkout ${VERSION/latest/HEAD}         && if [[ \"$VERSION\" =~ ^[0-9]+\\.[0-9]+$ ]]; then         echo '{vsn, \"'\"$VERSION.0\"'\"}.' >> vars.config;     else         echo '{vsn, \"0.0.0\"}.' >> vars.config;     fi         && mix deps.get     && (cd deps/eimp; ./configure)" did not complete successfully: exit code: 1
Error response from daemon: No such image: ejabberd/ecs:25.03

but when i do the same on linux ubuntu i can build ecs successfully

so my question is if building ecs on Mac is not possible?

this is my Dockerfile

FROM docker.io/golang:1.22-alpine AS api
RUN go install -v \
    github.com/processone/ejabberd-api/cmd/ejabberd@latest \
    && mv bin/ejabberd bin/ejabberdapi

FROM docker.io/ejabberd/mix AS builder
ARG VERSION
ENV VERSION=${VERSION:-latest} \
    MIX_ENV=prod
LABEL maintainer="ProcessOne <[email protected]>" \
    product="Ejabberd Community Server builder"

# Get ejabberd sources, dependencies, configuration
RUN git clone https://github.com/processone/ejabberd.git
WORKDIR /ejabberd
COPY vars.config .
COPY config.exs config/
COPY rel/*exs rel/
RUN git checkout ${VERSION/latest/HEAD} \
    \
    && if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+$ ]]; then \
        echo '{vsn, "'"$VERSION.0"'"}.' >> vars.config; \
    else \
        echo '{vsn, "0.0.0"}.' >> vars.config; \
    fi \
    \
    && mix deps.get \
    && (cd deps/eimp; ./configure)

# Compile
RUN MIX_ENV=prod mix release

# Prepare runtime environment
RUN mkdir runtime \
    && tar -C runtime -zxf _build/prod/ejabberd-*.tar.gz \
    && cd runtime \
    && cp releases/*/start.boot bin \
    && cp releases/*/start_clean.boot bin \
    && echo 'beam_lib:strip_files(filelib:wildcard("lib/*/ebin/*beam")), init:stop().' | erl >/dev/null \
    && mv erts*/bin/* bin \
    && EJABBERD_VERSION=`(cd releases; ls -1 -d *.*.*)` \
    && rm -rf releases erts* bin/*src bin/dialyzer bin/typer etc \
    && rm bin/ejabberd \
    && mkdir lib/ejabberd-$EJABBERD_VERSION/priv/bin \
    && cp /usr/lib/elixir/bin/* bin/ \
    && sed -i 's|ERL_EXEC="erl"|ERL_EXEC="/home/ejabberd/bin/erl"|' bin/elixir \
    && cp /ejabberd/tools/captcha*sh bin/ \
    && cp -r /ejabberd/sql lib/ejabberd-*/priv

# Runtime container
FROM docker.io/alpine:3.19
ARG VERSION
ARG VCS_REF
ARG BUILD_DATE
ENV TERM=xterm \
    LC_ALL=C.UTF-8 \
    LANG=en_US.UTF-8 \
    LANGUAGE=en_US.UTF-8 \
    REPLACE_OS_VARS=true \
    HOME=/home/ejabberd \
    PATH="$PATH:/home/ejabberd/bin" \
    VERSION=${VERSION:-latest}
LABEL maintainer="ProcessOne <[email protected]>" \
    product="Ejabberd Community Server Official Docker Image" \
    version=$VERSION \
    org.label-schema.vcs-ref=$VCS_REF \
    org.label-schema.vcs-url="https://github.com/processone/docker-ejabberd" \
    org.label-schema.build-date=$BUILD_DATE \
    org.label-schema.name="Ejabberd Community Server Official Docker Image" \
    org.label-schema.description="Robust, Scalable and Extensible Realtime Server using XMPP, MQTT and SIP" \
    org.label-schema.url="https://www.ejabberd.im/" \
    org.label-schema.vendor="ProcessOne" \
    org.label-schema.version=$VERSION \
    org.label-schema.schema-version="1.0"

# Create directory structure and user for ejabberd
RUN addgroup ejabberd -g 9000 \
    && adduser -s /bin/sh -D -G ejabberd ejabberd -u 9000 \
    && mkdir -p /home/ejabberd/conf /home/ejabberd/database /home/ejabberd/logs /home/ejabberd/upload \
    && chown -R ejabberd:ejabberd /home/ejabberd \
    && ln -fs /home/ejabberd /opt/ejabberd \
    && ln -fs /home/ejabberd /opt/ejabberd-$VERSION

# Install required dependencies
RUN apk upgrade --update-cache --no-progress \
    && apk add \
    expat \
    freetds \
    gd \
    jpeg \
    libgd \
    libpng \
    libstdc++ \
    libwebp \
    ncurses-libs \
    openssl \
    sqlite \
    sqlite-libs \
    tini \
    unixodbc \
    yaml \
    zlib \
    && ln -fs /usr/lib/libtdsodbc.so.0 /usr/lib/libtdsodbc.so \
    && rm -rf /var/cache/apk/*

# Install ejabberd

WORKDIR $HOME
COPY --from=builder /ejabberd/runtime .
COPY bin/* bin/
COPY --from=api /go/bin/ejabberdapi bin/ejabberdapi
RUN chmod 755 bin/ejabberdctl bin/ejabberdapi bin/erl bin/captcha*.sh \
    && mkdir -p /home/ejabberd/sql \
    && cp /home/ejabberd/lib/ejabberd-*/priv/sql/* /home/ejabberd/database/ \
    && cp /home/ejabberd/lib/ejabberd-*/priv/sql/* /home/ejabberd/sql/
COPY --chown=ejabberd:ejabberd conf conf/
ADD --chown=ejabberd:ejabberd https://download.process-one.net/cacert.pem conf/cacert.pem

# Setup runtime environment
.............more configurations .......................
Ngôn ngữ chính
Shell
Star
101
Fork
77
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của processone/docker-ejabberd

Tất cả issue của processone/docker-ejabberd

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.