docker-prosody icon indicating copy to clipboard operation
docker-prosody copied to clipboard

chown: missing operand

Open ncoder-1 opened this issue 7 years ago • 3 comments

I'm getting the following error when I docker run and it fails to start at all:

chown: missing operand Try 'chown --help' for more information.

This is with docker 17.11.0-ce on Arch

Here's a bit more detail:

[root prosody-docker]# docker build -t xmpp.example.com .                                                                                             
Sending build context to Docker daemon  9.728kB                                                                                                                        
Step 1/2 : FROM mazzolino/prosody                                                                                                                                      
 ---> d06cb22ae177                                                                                                                                                     
Step 2/2 : CMD chown prosody /var/lib/prosody && prosodyctl start                                                                                                      
 ---> Running in 8568f2bae49f                                                                                                                                          
2017-12-28T23:06:29.544242259Z container create 8568f2bae49fb29ba0f41c2dd1bcf3a98edac29b8d6a3bb20594915c89ac3786 (image=sha256:d06cb22ae17792c643cc021fb973a5205126e8c0
c4ee3109c57402ba2b310356, name=suspicious_darwin)                                                                                                                      
2017-12-28T23:06:29.591906291Z container commit 8568f2bae49fb29ba0f41c2dd1bcf3a98edac29b8d6a3bb20594915c89ac3786 (comment=, image=sha256:d06cb22ae17792c643cc021fb973a5
205126e8c0c4ee3109c57402ba2b310356, imageID=sha256:0b46343272f5e4ad184722067d464652caf9a81ff94936d0f84da005b13e03b0, imageRef=, name=suspicious_darwin)                
Removing intermediate container 8568f2bae49f                                                                                                                           
 ---> 0b46343272f5                                                                                                                                                     
Successfully built 0b46343272f5                                                                                                                                        
2017-12-28T23:06:29.602522632Z container destroy 8568f2bae49fb29ba0f41c2dd1bcf3a98edac29b8d6a3bb20594915c89ac3786 (image=sha256:d06cb22ae17792c643cc021fb973a5205126e8c
0c4ee3109c57402ba2b310356, name=suspicious_darwin)
Successfully tagged xmpp.example.com:latest
2017-12-28T23:06:29.609080602Z image tag sha256:0b46343272f5e4ad184722067d464652caf9a81ff94936d0f84da005b13e03b0 (name=xmpp.exa
mple.com:latest)
[root prosody-docker]# docker run -d -p 5222:5222 -p 5269:5269 -p 5280:5280 -p 5347:5347 -v $(pwd)/.prosody:/var/lib/prosody -e "XMPP_DOMAIN=example.com" xmpp.example.com                                                                                                                                                   
b1647363102d83563c44c205965a1761cf111326021863f66a11c6df73331044                                                                                                       
2017-12-28T23:06:50.785355478Z container create b1647363102d83563c44c205965a1761cf111326021863f66a11c6df73331044 (image=xmpp.example.com, name=suspicious_mestorf)     
2017-12-28T23:06:50.897701787Z network connect 70574a014e4a8b7c69abc35c4c3368fdbb44cddecd7eb253230705035e7aa20e (container=b1647363102d83563c44c205965a1761cf1113260218
63f66a11c6df73331044, name=bridge, type=bridge)
2017-12-28T23:06:51.111876566Z container start b1647363102d83563c44c205965a1761cf111326021863f66a11c6df73331044 (image=xmpp.exa
mple.com, name=suspicious_mestorf)
2017-12-28T23:06:51.148692336Z container die b1647363102d83563c44c205965a1761cf111326021863f66a11c6df73331044 (exitCode=1, image=xmpp.example.com, name=suspicious_mest
orf)
2017-12-28T23:06:51.265222756Z network disconnect 70574a014e4a8b7c69abc35c4c3368fdbb44cddecd7eb253230705035e7aa20e (container=b1647363102d83563c44c205965a1761cf1113260
21863f66a11c6df73331044, name=bridge, type=bridge)
[root prosody-docker]# ls -lRah
.:
total 24K
drwxr-xr-x 5 root root 4.0K Dec 28 23:06 .
drwxr-x--- 5 root root 4.0K Dec 28 21:53 ..
drwxr-xr-x 2 root root 4.0K Dec 28 21:53 certs
drwxr-xr-x 2 root root 4.0K Dec 28 21:52 conf.d
-rw-r--r-- 1 root root   78 Dec 28 21:52 Dockerfile
drwxr-xr-x 2  105 root 4.0K Dec 28 23:06 .prosody

./certs:
total 16K
drwxr-xr-x 2 root root 4.0K Dec 28 21:53 .
drwxr-xr-x 5 root root 4.0K Dec 28 23:06 ..
-rw-r--r-- 1 root root 1.9K Dec 28 21:53 ssl.cert
-rw------- 1 root root 3.2K Dec 28 21:53 ssl.key

./conf.d:
total 8.0K
drwxr-xr-x 2 root root 4.0K Dec 28 21:52 .
drwxr-xr-x 5 root root 4.0K Dec 28 23:06 ..

./.prosody:
total 8.0K
drwxr-xr-x 2  105 root 4.0K Dec 28 23:06 .
drwxr-xr-x 5 root root 4.0K Dec 28 23:06 ..

ncoder-1 avatar Dec 28 '17 22:12 ncoder-1

@elimpnick I don't quite understand what happens here. Can you a set -x at the top of docker-entrypoint, rebuild the image and run it again?

djmaze avatar Jan 17 '18 13:01 djmaze

It runs properly if I git clone your repo, and use your repo's Dockerfile instead of doing a Dockerfile with:

FROM mazzolino/prosody
CMD chown prosody /var/lib/prosody && prosodyctl start

ncoder-1 avatar Feb 03 '18 19:02 ncoder-1

Also, for some reason, I had to add: ADD certs /etc/prosody/certs/ in the Dockerfile (my certs weren't being copied over)

and change chown prosody /var/run/prosody /var/lib/prosody /etc/prosody/certs/* in docker-entrypoint (prosody couldn't read the certs/keys due to bad ownership)

in order to get TLS working.

ncoder-1 avatar Feb 03 '18 22:02 ncoder-1