processone / docker-ejabberd

Set of ejabberd Docker images
94 stars 77 forks source link

After build the docker image unable to run it. Getting ejabberdctl file not found error. #107

Closed naveenkumar-sreekumaran closed 9 months ago

naveenkumar-sreekumaran commented 9 months ago

I have cloned the docker-ejabberd source and built the image using below command in visual studio code terminal. I am also using rancher desktop.

docker build -f Dockerfile --no-cache -t ejabberdarchive:40 .

Then when I run the docker image using the below command I am getting,

**[FATAL tini (7)] exec /home/ejabberd/bin/ejabberdctl failed: No such file or directory** error
docker run -it -p 5443:5443 ejabberdarchive:40 live

Build log does not indicate any error either. Please help me identify the issue.

 => [internal] load build definition from Dockerfile                               0.0s
 => => transferring dockerfile: 3.92kB                                             0.0s
 => [internal] load .dockerignore                                                  0.0s
 => => transferring context: 2B                                                    0.0s
 => [internal] load metadata for docker.io/library/alpine:3.17                     3.8s
 => [internal] load metadata for docker.io/library/golang:1.20-alpine              3.9s
 => [internal] load metadata for docker.io/ejabberd/mix:latest                     3.8s
 => CACHED https://download.process-one.net/cacert.pem                             2.7s
 => CACHED [builder  1/10] FROM docker.io/ejabberd/mix@sha256:c119cad093b36936c69  0.0s
 => [internal] load build context                                                  0.0s
 => => transferring context: 471B                                                  0.0s
 => CACHED [api 1/2] FROM docker.io/library/golang:1.20-alpine@sha256:b482fd8d206  0.0s
 => CACHED [stage-2  1/10] FROM docker.io/library/alpine:3.17@sha256:6e94b5cda2d6  0.0s 
 => [api 2/2] RUN go install -v     github.com/processone/ejabberd-api/cmd/ejabb  23.9s
 => [builder  2/10] RUN git clone https://github.com/processone/ejabberd.git      10.9s 
 => [stage-2  2/10] RUN addgroup ejabberd -g 9000     && adduser -s /bin/sh -D -G  0.9s 
 => [stage-2  3/10] RUN apk upgrade --update-cache --no-progress     && apk add    5.7s 
 => [stage-2  4/10] WORKDIR /home/ejabberd                                         0.1s 
 => [builder  3/10] WORKDIR /ejabberd                                              0.1s 
 => [builder  4/10] COPY vars.config .                                             0.1s 
 => [builder  5/10] RUN echo '{vsn, "'latest'.0"}.' >>vars.config                  0.5s 
 => [builder  6/10] COPY config.exs config/                                        0.1s 
 => [builder  7/10] COPY rel/*exs rel/                                             0.1s 
 => [builder  8/10] RUN git checkout ${VERSION/latest/HEAD}     && mix deps.get   15.6s 
 => [builder  9/10] RUN MIX_ENV=prod mix release                                 157.7s 
 => [stage-2  5/10] COPY --from=builder /ejabberd/runtime .                        0.4s 
 => [stage-2  6/10] COPY bin/* bin/                                                0.1s 
 => [stage-2  7/10] COPY --from=api /go/bin/ejabberdapi bin/ejabberdapi            0.1s 
 => [stage-2  8/10] RUN chmod 755 /home/ejabberd/bin/ejabberdctl /home/ejabberd/b  0.4s 
 => [stage-2  9/10] COPY --chown=ejabberd:ejabberd conf conf/                      0.1s 
 => [stage-2 10/10] ADD --chown=ejabberd:ejabberd https://download.process-one.ne  0.1s 
 => exporting to image                                                             0.7s 
 => => exporting layers                                                            0.6s 
 => => writing image sha256:0d9c332cd91828a7e32bceb9858ab02a680da93c37316b8cd8d2a  0.0s 
 => => naming to docker.io/library/ejabberdarchive:40
badlop commented 9 months ago

Strange, your exact commands work for me, using the latest commit from docker-ejabberd git

$ git describe
22.05-33-g72d317a

Also, your docker build log shows that this succeeds chmod 755 /home/ejabberd/bin/ejabberdctl.

Can you confirm the file exists and is executable in the image?

I guess this doesn't work either:

$ docker run -it -p 5443:5443 ejabberdarchive:41 
2023-12-12 11:41:46.140602+00:00 [info] Loading configuration from /home/ejabberd/conf/ejabberd.yml
...
naveenkumar-sreekumaran commented 9 months ago

Thanks for your reply,

I can find the ejabberdctl file with executable permissions using the below entrypoint command. However, I am not sure whether home/ejabberd directory exists.

docker run --rm -it --entrypoint /bin/sh ejabberdarchive:40

image

Anyway, I tried the same with Ubuntu 22.04 WSL and it worked fine there.