4

I am an arch newbie and I have been trying to install preview of mattermost(slack alternative) on docker to try it out. I have been following the official guide.

Arch

Install Docker using the following commands:

pacman -S docker
systemctl enable docker.service
systemctl start docker.service
gpasswd -a <username> docker
newgrp docker

Start Docker container:

docker run --name mattermost-preview -d --publish 8065:8065 mattermost/mattermost-preview

When Docker is done fetching the image, open http://localhost:8065/ in your browser.

Unfortunately I can't open the localhost:8065 service.

I have listed this issue in error trackers of both Docker https://github.com/docker/docker/issues/23730

I installed it on ubuntu 14.04 and still encountering the same problem.

output of docker info

Containers: 3
 Running: 1
 Paused: 0
 Stopped: 2
Images: 2
Server Version: 1.11.2
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 33
 Dirperm1 Supported: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: null host bridge
Kernel Version: 3.13.0-32-generic
Operating System: Ubuntu 14.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 3.767 GiB
Name: warmachine
ID: FICU:HLW6:7J7X:NFWJ:HX27:32U4:HQZB:I2UW:K5TI:DDAB:EBC3:F2LW
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support

output of docker version

Client:
Version:      1.11.2    
API version:  1.23
Go version:   go1.5.4
Git commit:   b9f10c9
Built:        Wed Jun  1 21:47:50 2016
OS/Arch:      linux/amd64

Server:
Version:      1.11.2
API version:  1.23
Go version:   go1.5.4
Git commit:   b9f10c9
Built:        Wed Jun  1 21:47:50 2016
OS/Arch:      linux/amd64
PrivateOmega
  • 2,509
  • 1
  • 17
  • 27
  • @vitr I hope this is what u meant. i ran the docker ps -a command and this is my output. It says the docker container should be available through host port. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7d5f522a1df2 mattermost/mattermost-preview "/bin/sh -c ./docker-" 4 seconds ago Up 2 seconds 3306/tcp, 0.0.0.0:8065->8065/tcp mattermost-preview – PrivateOmega Jun 18 '16 at 15:33
  • If you can't see the container without `-a` that means it's not running – vitr Jun 18 '16 at 23:41
  • @vitr I can view the container without -a option. So how to proceed from here. – PrivateOmega Jun 19 '16 at 06:27
  • I just tried mattermost-preview on ubuntu, got the same issue as you(( good luck hunting this down – vitr Jun 19 '16 at 06:30
  • I too tried running it on a fresh install of ubuntu. I think its got something to do with docker rather than mattermost. – PrivateOmega Jun 19 '16 at 06:34
  • doesn't matter arch or ubuntu, I've got `refused to connect` – vitr Jun 19 '16 at 06:37
  • they messed up something, try to open an issue on github – vitr Jun 19 '16 at 06:43
  • yes.same here.will do. – PrivateOmega Jun 19 '16 at 07:38

2 Answers2

3

This appears to be an issue with the packaging of the app. It's been reported on their github

To rule out any issues with your own docker install, you can always test the port forwarding with something like:

docker run -it --rm -p 8080:80 debian /bin/sh -c "apt-get update; apt-get install -yq netcat; nc -l -p 80"

And then in another terminal:

nc -q 1 127.0.0.1 8080 <<EOF
hello world
EOF

If you see a "hello world" on the docker terminal, then your docker install is fine.

BMitch
  • 231,797
  • 42
  • 475
  • 450
  • Definitely a packaging issue - their docker image simply does `sleep 20` after starting mysql so it may well not be ready. I made a [pull request](https://github.com/mattermost/mattermost-docker-preview/pull/5). – joelnb Jun 19 '16 at 21:51
2

In my case mysql is not yet ready at the time when mattermost starts.

The solution is to clone the official repo to my local directory > Go into the directory > Edit docker-entry.sh file and change the line sleep 20 to some higher value like 100.

After that execute

docker build -t somename/mattermost . docker run --name mattermost-preview -d --publish 8065:8065 somename/mattermost

If it still doesnt work replace 8065:8065 part with SomeRandomPort:8065 and execute above line with a different name for docker container.

Thanks to https://github.com/joelnb for the solution.

Siv
  • 1,026
  • 19
  • 29
PrivateOmega
  • 2,509
  • 1
  • 17
  • 27