mirror of https://github.com/zulip/zulip.git
Remove legacy (pre-Vagrant) Docker development environment setup.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
cd9c1bfb9d
commit
b4204e7cfd
|
@ -1,17 +0,0 @@
|
||||||
FROM ubuntu:trusty
|
|
||||||
|
|
||||||
EXPOSE 9991
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y wget
|
|
||||||
|
|
||||||
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
|
|
||||||
|
|
||||||
RUN useradd -d /home/zulip -m zulip && echo 'zulip ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
|
||||||
|
|
||||||
USER zulip
|
|
||||||
|
|
||||||
RUN ln -nsf /srv/zulip ~/zulip
|
|
||||||
RUN echo 'export LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8" LANGUAGE="en_US.UTF-8"' >> ~zulip/.bashrc
|
|
||||||
RUN echo 'export LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8" LANGUAGE="en_US.UTF-8"' >> ~zulip/.bash_profile
|
|
||||||
|
|
||||||
WORKDIR /srv/zulip
|
|
|
@ -33,8 +33,6 @@ development environment:
|
||||||
**[install without using Vagrant][install-direct]**.
|
**[install without using Vagrant][install-direct]**.
|
||||||
* On **other Linux/UNIX** distributions, you'll need to follow slightly different
|
* On **other Linux/UNIX** distributions, you'll need to follow slightly different
|
||||||
instructions to **[install manually][install-generic]**.
|
instructions to **[install manually][install-generic]**.
|
||||||
* On **macOS and Linux** (Ubuntu recommended), you can install **[using
|
|
||||||
Docker][install-docker]**, though support for this remains experimental.
|
|
||||||
|
|
||||||
Unfortunately, the only supported method to install on Windows is the [Vagrant
|
Unfortunately, the only supported method to install on Windows is the [Vagrant
|
||||||
method][install-vagrant].
|
method][install-vagrant].
|
||||||
|
@ -84,7 +82,6 @@ machine, take a look at our tips for
|
||||||
|
|
||||||
[dev-remote]: remote.html
|
[dev-remote]: remote.html
|
||||||
[install-direct]: ../development/setup-advanced.html#installing-directly-on-ubuntu-debian-centos-or-fedora
|
[install-direct]: ../development/setup-advanced.html#installing-directly-on-ubuntu-debian-centos-or-fedora
|
||||||
[install-docker]: ../development/setup-advanced.html#using-docker-experimental
|
|
||||||
[install-generic]: ../development/setup-advanced.html#installing-manually-on-unix
|
[install-generic]: ../development/setup-advanced.html#installing-manually-on-unix
|
||||||
[install-vagrant]: ../development/setup-vagrant.html
|
[install-vagrant]: ../development/setup-vagrant.html
|
||||||
[self-install-remote]: #installing-remotely
|
[self-install-remote]: #installing-remotely
|
||||||
|
|
|
@ -5,7 +5,6 @@ Contents:
|
||||||
* [Installing directly on Ubuntu, Debian, Centos, or Fedora](#installing-directly-on-ubuntu-debian-centos-or-fedora)
|
* [Installing directly on Ubuntu, Debian, Centos, or Fedora](#installing-directly-on-ubuntu-debian-centos-or-fedora)
|
||||||
* [Installing manually on other Linux/UNIX](#installing-manually-on-unix)
|
* [Installing manually on other Linux/UNIX](#installing-manually-on-unix)
|
||||||
* [Installing directly on cloud9](#installing-on-cloud9)
|
* [Installing directly on cloud9](#installing-on-cloud9)
|
||||||
* [Using Docker (experimental)](#using-docker-experimental)
|
|
||||||
|
|
||||||
## Installing directly on Ubuntu, Debian, Centos, or Fedora
|
## Installing directly on Ubuntu, Debian, Centos, or Fedora
|
||||||
|
|
||||||
|
@ -259,110 +258,6 @@ automatically forward the connection. You might want to visit
|
||||||
[wiki](https://github.com/cPhost/zulip-cloud9/wiki) for more info on
|
[wiki](https://github.com/cPhost/zulip-cloud9/wiki) for more info on
|
||||||
how to use zulip-cloud9 package.
|
how to use zulip-cloud9 package.
|
||||||
|
|
||||||
## Using Docker (experimental)
|
|
||||||
|
|
||||||
Start by [cloning your fork of the Zulip repository][zulip-rtd-git-cloning]
|
|
||||||
and [connecting the Zulip upstream repository][zulip-rtd-git-connect]:
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone --config pull.rebase https://github.com/YOURUSERNAME/zulip.git
|
|
||||||
git remote add -f upstream https://github.com/zulip/zulip.git
|
|
||||||
```
|
|
||||||
|
|
||||||
The docker instructions for development are experimental, so they may
|
|
||||||
have bugs. If you try them and run into any issues, please report
|
|
||||||
them!
|
|
||||||
|
|
||||||
You can also use Docker to run a Zulip development environment.
|
|
||||||
First, you need to install Docker in your development machine
|
|
||||||
following the [instructions][docker-install]. Some other interesting
|
|
||||||
links for somebody new in Docker are:
|
|
||||||
|
|
||||||
* [Get Started](https://docs.docker.com/get-started/)
|
|
||||||
* [Understand the architecture](https://docs.docker.com/engine/docker-overview/)
|
|
||||||
* [Docker run reference](https://docs.docker.com/engine/reference/run/)
|
|
||||||
* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/)
|
|
||||||
|
|
||||||
[docker-install]: https://docs.docker.com/engine/installation/
|
|
||||||
|
|
||||||
Then you should create the Docker image based on Ubuntu Linux, first
|
|
||||||
go to the directory with the Zulip source code:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker build -t user/zulipdev -f Dockerfile-dev .
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
Commit and tag the provisioned images. The below will install Zulip's dependencies:
|
|
||||||
```
|
|
||||||
docker run -itv $(pwd):/srv/zulip -p 9991:9991 user/zulipdev /bin/bash
|
|
||||||
$ /bin/bash sudo chown -R zulip:zulip /srv/zulip
|
|
||||||
$ /bin/bash /srv/zulip/tools/provision --docker
|
|
||||||
docker ps -af ancestor=user/zulipdev
|
|
||||||
docker commit -m "Zulip installed" <container id> user/zulipdev:v2
|
|
||||||
```
|
|
||||||
|
|
||||||
Now you can run the docker server with:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker run -itv $(pwd):/srv/zulip -p 9991:9991 user/zulipdev:v2 \
|
|
||||||
/srv/zulip/tools/start-dockers
|
|
||||||
```
|
|
||||||
|
|
||||||
You'll want to
|
|
||||||
[read the guide for Zulip development](../development/setup-vagrant.html#step-4-developing)
|
|
||||||
to understand how to use the Zulip development. Note that
|
|
||||||
`start-dockers` automatically runs `tools/run-dev.py` inside the
|
|
||||||
container; you can then visit http://localhost:9991 to connect to your
|
|
||||||
new Zulip Docker container.
|
|
||||||
|
|
||||||
|
|
||||||
To view the container's `run-dev.py` console logs to get important
|
|
||||||
debugging information (and e.g. outgoing emails) printed by the Zulip
|
|
||||||
development environment, you can use:
|
|
||||||
```
|
|
||||||
docker logs --follow <container id>
|
|
||||||
```
|
|
||||||
|
|
||||||
To restart the server use:
|
|
||||||
```
|
|
||||||
docker ps
|
|
||||||
docker restart <container id>
|
|
||||||
```
|
|
||||||
|
|
||||||
To stop the server use:
|
|
||||||
```
|
|
||||||
docker ps
|
|
||||||
docker kill <container id>
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to connect to the Docker instance to run commands
|
|
||||||
(e.g. build a release tarball), you can use:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker ps
|
|
||||||
docker exec -it <container id> /bin/bash
|
|
||||||
$ source /home/zulip/.bash_profile
|
|
||||||
$ <Your commands>
|
|
||||||
$ exit
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to run all the tests you need to start the servers first,
|
|
||||||
you can do it with:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker run -itv $(pwd):/srv/zulip user/zulipdev:v2 /bin/bash
|
|
||||||
$ tools/test-all-docker
|
|
||||||
```
|
|
||||||
|
|
||||||
You can modify the source code in your development machine and review
|
|
||||||
the results in your browser.
|
|
||||||
|
|
||||||
|
|
||||||
Currently, the Docker workflow is substantially less convenient than
|
|
||||||
the Vagrant workflow and less documented; please contribute to this
|
|
||||||
guide and the Docker tooling if you are using Docker to develop Zulip!
|
|
||||||
|
|
||||||
[zulip-rtd-git-cloning]: ../git/cloning.html#step-1b-clone-to-your-machine
|
[zulip-rtd-git-cloning]: ../git/cloning.html#step-1b-clone-to-your-machine
|
||||||
[zulip-rtd-git-connect]: ../git/cloning.html#step-1c-connect-your-fork-to-zulip-upstream
|
[zulip-rtd-git-connect]: ../git/cloning.html#step-1c-connect-your-fork-to-zulip-upstream
|
||||||
[port-forward-setup]: ../development/remote.html#running-the-development-server
|
[port-forward-setup]: ../development/remote.html#running-the-development-server
|
||||||
|
|
|
@ -511,12 +511,6 @@ def main(options):
|
||||||
for service in ["postgresql-%s" % (POSTGRES_VERSION,), "rabbitmq-server", "memcached", "redis"]:
|
for service in ["postgresql-%s" % (POSTGRES_VERSION,), "rabbitmq-server", "memcached", "redis"]:
|
||||||
run_as_root(["systemctl", "enable", service], sudo_args = ['-H'])
|
run_as_root(["systemctl", "enable", service], sudo_args = ['-H'])
|
||||||
run_as_root(["systemctl", "start", service], sudo_args = ['-H'])
|
run_as_root(["systemctl", "start", service], sudo_args = ['-H'])
|
||||||
elif options.is_docker:
|
|
||||||
run_as_root(["service", "rabbitmq-server", "restart"])
|
|
||||||
run_as_root(["pg_dropcluster", "--stop", POSTGRES_VERSION, "main"])
|
|
||||||
run_as_root(["pg_createcluster", "-e", "utf8", "--start", POSTGRES_VERSION, "main"])
|
|
||||||
run_as_root(["service", "redis-server", "restart"])
|
|
||||||
run_as_root(["service", "memcached", "restart"])
|
|
||||||
if not options.is_production_travis:
|
if not options.is_production_travis:
|
||||||
# The following block is skipped for the production Travis
|
# The following block is skipped for the production Travis
|
||||||
# suite, because that suite doesn't make use of these elements
|
# suite, because that suite doesn't make use of these elements
|
||||||
|
@ -626,10 +620,5 @@ if __name__ == "__main__":
|
||||||
default=False,
|
default=False,
|
||||||
help="Provision for Travis with production settings.")
|
help="Provision for Travis with production settings.")
|
||||||
|
|
||||||
parser.add_argument('--docker', action='store_true',
|
|
||||||
dest='is_docker',
|
|
||||||
default=False,
|
|
||||||
help="Provision for Docker.")
|
|
||||||
|
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
sys.exit(main(options))
|
sys.exit(main(options))
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
sudo service rabbitmq-server restart
|
|
||||||
sudo service postgresql restart
|
|
||||||
sudo service redis-server restart
|
|
||||||
sudo service memcached restart
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
source /home/zulip/.bash_profile
|
|
||||||
/srv/zulip/scripts/setup/configure-rabbitmq
|
|
||||||
/srv/zulip/tools/run-dev.py --interface=''
|
|
|
@ -1,9 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
sudo service rabbitmq-server restart
|
|
||||||
sudo service postgresql restart
|
|
||||||
sudo service redis-server restart
|
|
||||||
sudo service memcached restart
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
source /home/zulip/.bash_profile
|
|
||||||
/srv/zulip/tools/test-all
|
|
Loading…
Reference in New Issue