HUB
Sign inSign up
dockerchat logo

alnat/dockerchat

By alnat

•Updated about 11 years ago

Image
0

226

alnat/dockerchat repository overview

This is a public beta version of an official Docker image of JetBrains Hub⁠. It is suitable for evaluation and testing purposes. For production environment, use this image with caution.

⁠How to Use Hub Image

Pull the image from the Docker Hub Repository:

docker pull jetbrains/hub:<version>

As the <version>, specify a tag that contains Hub release version including the build number. For example: docker pull jetbrains/hub:2017.4.8765

For the list of available versions, refer to the Tags List⁠.

To view a list of commands that are supported by the entry point of Hub docker image, run the help command: docker run --rm -it jetbrains/hub:<version> help

⁠Start Hub Container
⁠Create and Configure Hub-specific Directories

Hub image container is a stateful container. Thus, before running it, you should create specific directories on the host machine to store Hub database, configuration files, logs, backups, and pass them to the Hub container as volumes. Otherwise, you risk losing Hub data when the container is removed.

These directories are:

  • data — a directory where Hub stores its database. For a new installation, this directory must be empty.
  • conf — a directory where Hub stores configuration files that contain environment settings, JVM options, Hub integration settings, and so on.
  • logs — a directory where Hub stores its log files.
  • backups — a directory where Hub stores backups. For more information about managing backup files, refer to the Hub documentation⁠.

Another condition for Hub-specific directories is that they must be accessible to the user account that is used to run Hub service inside the container. Hub uses the non-root account 13001:13001 (group:id, respectively).

For example, if you use a Linux host machine, you can execute the following commands to create and configure Hub directories:

mkdir -p -m 750 <path to data directory> <path to logs directory> <path to conf directory> <path to backups directory>
chown -R 13001:13001 <path to data directory> <path to logs directory> <path to conf directory> <path to backups directory>

When done, you can define the mapping between the directories on the host machine and inside the docker container as the attributes of the docker run command.

⁠Run the Container

To run Hub container, execute the command:

docker run -it --name hub-server-instance  \
    -v <path to data directory>:/opt/hub/data \
    -v <path to conf directory>:/opt/hub/conf  \
    -v <path to logs directory>:/opt/hub/logs  \
    -v <path to backups directory>:/opt/hub/backups  \
    -p <port on host>:8080 \
    jetbrains/hub:<version>

Command attributes:

  • -it — a flag that attaches Hub container input and output including the startup logs to the terminal window. Note that pressing Ctrl+C when the terminal is attached to a container output causes the container to shut down. Use Ctrl+PQ in order to detach the terminal from container output. For more details, see the official docker documentation⁠.
  • --name hub-server-instance — the arbitrary name for the container.
  • -v <path to NNN directory>:/opt/hub/NNN — binding the Hub-specific NNN directory on the host machine to the respective /opt/hub/NNN directory inside the container.
  • -p <port on host>:8080 — parameter that defines the ports mapping. It instructs the host machine to listen on port <port on host> and propagate all traffic to the port 8080 inside the docker container.

When you run the container for the first time, the web-based Configuration Wizard starts on the main service port. It lets you configure the main parameters of the new Hub service. You can also skip the web-based configuration, and run Hub service with the default parameters. For more details, refer to Hub documentation⁠.

⁠Access the Running Hub Service

By default, the service starts on {0.0.0.0:8080} inside the Docker container. Port 8080 is mapped to a <port on host> in the start command. This way, the service can be accessed from any machine that has network access to the port <port on host> of the host machine. For example, if the FQDN of the host machine is host.mydomain.com, then the service is available at http://<host.mydomain.com>:<port on host>.

⁠Stop Hub

To stop the Hub service gracefully, run the command: docker exec <containerId> stop

For a graceful shutdown, you can also use the standard docker kill --signal=SIGTERM <containerId> command.

We do not recommend using the standard command docker stop. By default, this command sends the SIGTERM signal to the Hub process inside the Docker container, then waits for 10 seconds. If Hub does not finish the shutdown within that time period, the SIGKILL is sent to the kernel and the Hub process is killed. This may lead to data corruption. To avoid this outcome, specify an appropriate timeout value when using this command. For example, the following command leaves enough time for the Hub service to shut down: docker stop -t 60 <containerId>

⁠Configure Hub

You can configure Hub from a command line, including the properties that are set in the Configuration Wizard on the first start. Stop the Hub service and run the configure command:

docker run -it --rm \
    -v <path to data directory>:/opt/hub/data \
    -v <path to conf directory>:/opt/hub/conf  \
    -v <path to logs directory>:/opt/hub/logs  \
    -v <path to backups directory>:/opt/hub/backups  \
    -p <port on host>:8080 \
    jetbrains/hub:<version> \
    configure \
    <arguments>

Command attributes:

For more details on the format of the configure command, run docker ru--rmn -it jetbrains/hub:<version> help.

When you execute the configure command, make sure to keep all local system paths in volume mappings the same as the mappings specified in the run command for the main server. Otherwise, updates are not applied to the Hub configuration files.

⁠Upgrade Hub

If you use the original Hub docker image, then you can just stop the running container, pull a newer version of the Hub image, and run the server with the usual command. Make sure to provide mapping for volumes with application data from the previous version.

When you run the new version container and it finishes the startup process, the web-based Upgrade Wizard is deployed and listens on the Hub main port and a non-root context. The URL of the Upgrade Wizard is printed at the startup container console and is recorded in the logs. To locate the Upgrade Wizard URL, search the startup console logs for a record that contains a phrase like "Configuration Wizard will be available on [http://<host>:<port>/contextPath] after start".

As soon as the Upgrade Wizard is complete, the Hub service starts.

For more details, see the Hub documentaion⁠.

⁠License

The Docker image is available under the Hub license. Hub is free for perpetual use.

Licensing details⁠

⁠Feedback

Report issues or suggestions in the Hub issue tracker⁠

⁠Under the Hood

This Docker image is built on top of a base image which includes:

Tag summary
Recent tags
Content type
Image
Digest
sha256:f5d479c2c…
Size
164.8 MB
Last updated
about 11 years ago
docker pull alnat/dockerchat:v1