agross/hubThis Dockerfile allows you to build images to deploy your own Hub instance. It has been tested on Fedora 23 and CentOS 7.
Please remember to back up your data directories often, especially before upgrading to a newer version.
shdocker run -it -p 8080:8080 agross/hub
http://localhost:8080.shHUB_DATA="/var/data/hub" HUB_LOGS="/var/log/hub" DOMAIN=example.com PORT=8010
shmkdir --parents "$HUB_DATA/backups" \ "$HUB_DATA/conf" \ "$HUB_DATA/data" \ "$HUB_LOGS"
The Dockerfile creates a hub user and group. This user has a UID and GID of 4000. Make sure to add a user to your host system with this UID and GID and allow this user to read and write to $HUB_DATA and $HUB_LOGS. The name of the host user and group in not important.
sh# Create hub group and user in docker host, e.g.: groupadd --gid 4000 --system hub useradd --uid 4000 --gid 4000 --system --shell /sbin/nologin --comment "JetBrains Hub" hub # 4000 is the ID of the hub user and group created by the Dockerfile. chown -R 4000:4000 "$HUB_DATA" "$HUB_LOGS"
Note: The :z option on the volume mounts makes sure the SELinux context of the directories are set appropriately.
/etc/localtime needs to be bind-mounted to use the same time zone as your docker host.
shdocker create -it -p $PORT:8080 \ -v /etc/localtime:/etc/localtime:ro \ -v "$HUB_DATA/backups:/hub/backups:z" \ -v "$HUB_DATA/conf:/hub/conf:z" \ -v "$HUB_DATA/data:/hub/data:z" \ -v "$HUB_LOGS:/hub/logs:z" \ --name hub \ agross/hub
/etc/systemd/system/hub.service.shcat <<EOF > "/etc/systemd/system/hub.service" [Unit] Description=JetBrains Hub Requires=docker.service After=docker.service [Service] Restart=always # When docker stop is executed, the docker-entrypoint.sh trap + wait combination # will generate an exit status of 143 = 128 + 15 (SIGTERM). # More information: [***] SuccessExitStatus=143 PrivateTmp=true ExecStart=/usr/bin/docker start --attach=true hub ExecStop=/usr/bin/docker stop --time=60 hub [Install] WantedBy=multi-user.target EOF systemctl enable hub.service systemctl start hub.service
/etc/logrotate.d/hub.shcat <<EOF > "/etc/logrotate.d/hub" $HUB_LOGS/*.log $HUB_LOGS/dashboard/*.log $HUB_LOGS/hub/*.log $HUB_LOGS/hub/logs/*.log $HUB_LOGS/internal/services/bundleProcess/*.log $HUB_LOGS/project-wizard/*.log { rotate 7 daily dateext missingok notifempty sharedscripts copytruncate compress } EOF
/etc/nginx/conf.d/hub.conf.shcat <<EOF > "/etc/nginx/conf.d/hub.conf" upstream hub { server localhost:$PORT; } server { listen 80; listen [::]:80; server_name $DOMAIN; access_log /var/log/nginx/$DOMAIN.access.log; error_log /var/log/nginx/$DOMAIN.error.log; # Do not limit upload. client_max_body_size 0; # Required to avoid HTTP 411: see issue #1486 ([***] chunked_transfer_encoding on; location / { proxy_pass [***] proxy_set_header Host \$host; proxy_set_header X-Real-IP \$remote_addr; proxy_set_header X-Forwarded-Host \$http_host; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto \$scheme; proxy_http_version 1.1; } } EOF nginx -s reload
Make sure SELinux policy allows nginx to access port $PORT (the first part of -p $PORT:8080 of step 3).
shif [ $(semanage port --list | grep --count "^http_port_t.*$PORT") -eq 0 ]; then if semanage port --add --type http_port_t --proto tcp $PORT; then echo Added port $PORT as a valid port for nginx: semanage port --list | grep ^http_port_t else >&2 echo Could not add port $PORT as a valid port for nginx. Please add it yourself. More information: [***] fi else echo Port $PORT is already a valid port for nginx: semanage port --list | grep ^http_port_t fi
Follow the steps of the installation instructions for JetBrains Hub using paths inside the docker container located under
/hub/backups,/hub/data,/hub/logs and/hub/temp.shdocker pull agross/hub systemctl stop hub.service # Back up $HUB_DATA. tar -zcvf "hub-data-$(date +%F-%H-%M-%S).tar.gz" "$HUB_DATA" docker rm hub # Repeat step 4 and create a new image. docker create ... systemctl start hub.service
DockerfileDockerfile.shdocker build --tag agross/hub:testing . docker images # Should contain: # REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE # agross/hub testing 0dcb8bf6093f 49 seconds ago 405.4 MB
shTEST_DIR="/tmp/hub-testing" mkdir --parents "$TEST_DIR/backups" \ "$TEST_DIR/conf" \ "$TEST_DIR/data" \ "$TEST_DIR/logs" chown -R 4000:4000 "$TEST_DIR"
Note: The :z option on the volume mounts makes sure the SELinux context of the directories are set appropriately.
shdocker run -it --rm \ --name hub-testing \ -p 8080:8080 \ -v "$TEST_DIR/backups:/hub/backups:z" \ -v "$TEST_DIR/conf:/hub/conf:z" \ -v "$TEST_DIR/data:/hub/data:z" \ -v "$TEST_DIR/logs:/hub/logs:z" \ agross/hub:testing
shdocker exec -it hub-testing bash
Note: The :z option on the volume mounts makes sure the SELinux context of the directories are set appropriately.
shdocker run -it -v "$TEST_DIR/backups:/hub/backups:z" \ -v "$TEST_DIR/conf:/hub/conf:z" \ -v "$TEST_DIR/data:/hub/data:z" \ -v "$TEST_DIR/logs:/hub/logs:z" \ agross/hub:testing bash
Without mounted data directories:
shdocker run -it agross/hub:testing bash
shdocker ps -aq --no-trunc --filter ancestor=agross/hub:testing | xargs --no-run-if-empty docker rm docker images -q --no-trunc agross/hub:testing | xargs --no-run-if-empty docker rmi rm -rf "$TEST_DIR"
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像服务
在 Docker Desktop 配置镜像
Docker Compose 项目配置
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
MacOS OrbStack 容器配置
在宝塔面板一键配置镜像
Synology 群晖 NAS 配置
飞牛 fnOS 系统配置镜像
极空间 NAS 系统配置服务
爱快 iKuai 路由系统配置
绿联 NAS 系统配置镜像
QNAP 威联通 NAS 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
来自真实用户的反馈,见证轩辕镜像的优质服务