Skip to content

Commit 90f9797

Browse files
committed
Change web ports to 8080 and 8443
The default should be the non-privileged ports. This is also in preparation of running as non-root user. Update the Readme with current information.
1 parent 9e6ed40 commit 90f9797

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ RUN set -eux ; \
2424
rm -f gitblit.tar.gz ; \
2525
mv /opt/gitblit/data /opt/gitblit-data ; \
2626
ln -s /opt/gitblit-data /opt/gitblit/data ; \
27-
echo "server.httpPort=80" >> /opt/gitblit-data/gitblit.properties ; \
28-
echo "server.httpsPort=443" >> /opt/gitblit-data/gitblit.properties ; \
27+
echo "server.httpPort=8080" >> /opt/gitblit-data/gitblit.properties ; \
28+
echo "server.httpsPort=8443" >> /opt/gitblit-data/gitblit.properties ; \
2929
echo "server.redirectToHttpsPort=true" >> /opt/gitblit-data/gitblit.properties ; \
3030
echo "web.enableRpcManagement=true" >> /opt/gitblit-data/gitblit.properties ; \
3131
echo "web.enableRpcAdministration=true" >> /opt/gitblit-data/gitblit.properties
3232

3333
# Setup the Docker container environment
3434
WORKDIR /opt/gitblit
3535

36-
EXPOSE 80 443 9418 29418
36+
EXPOSE 8080 8443 9418 29418
3737

3838
# run application
3939
CMD ["java", "-server", "-Xmx1024M", "-Djava.awt.headless=true", "-cp", "gitblit.jar:ext/*", "com.gitblit.GitBlitServer", "--baseFolder", "/opt/gitblit-data"]

Dockerfile.alpine

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ RUN set -eux; \
2020
rm -f gitblit.tar.gz ; \
2121
mv /opt/gitblit/data /opt/gitblit-data ; \
2222
ln -s /opt/gitblit-data /opt/gitblit/data ; \
23-
echo "server.httpPort=80" >> /opt/gitblit-data/gitblit.properties ; \
24-
echo "server.httpsPort=443" >> /opt/gitblit-data/gitblit.properties ; \
23+
echo "server.httpPort=8080" >> /opt/gitblit-data/gitblit.properties ; \
24+
echo "server.httpsPort=8443" >> /opt/gitblit-data/gitblit.properties ; \
2525
echo "server.redirectToHttpsPort=true" >> /opt/gitblit-data/gitblit.properties ; \
2626
echo "web.enableRpcManagement=true" >> /opt/gitblit-data/gitblit.properties ; \
2727
echo "web.enableRpcAdministration=true" >> /opt/gitblit-data/gitblit.properties
2828

2929
# Setup the Docker container environment
3030
WORKDIR /opt/gitblit
3131

32-
EXPOSE 80 443 9418 29418
32+
EXPOSE 8080 8443 9418 29418
3333

3434
# run application
3535
CMD ["java", "-server", "-Xmx1024M", "-Djava.awt.headless=true", "-cp", "gitblit.jar:ext/*", "com.gitblit.GitBlitServer", "--baseFolder", "/opt/gitblit-data"]

README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
# Gitblit & Docker
22

3-
These instructions assume you are running Ubuntu and you have already installed Docker.
3+
These instructions assume you are running Linux and you have already [installed Docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/).
44

5-
```
6-
sudo apt-get install docker.io
7-
```
85

96
## Running Gitblit in Docker
107

11-
You can use the Gitblit Docker image I have created [here](https://registry.hub.docker.com/u/jmoger/gitblit).
8+
You can use the official [Gitblit Docker image](https://hub.docker.com/r/gitblit/gitblit).
129

1310
```
14-
sudo docker.io pull jmoger/gitblit
15-
<wait a while>
16-
sudo docker.io run -d --name gitblit -p 443:443 -p 80:80 -p 9418:9418 -p 29418:29418 jmoger/gitblit
11+
sudo docker pull gitblit/gitblit
12+
sudo docker run -d --name gitblit -p 8443:8443 -p 8080:8080 -p 9418:9418 -p 29418:29418 gitblit/gitblit
1713
```
1814

19-
The followings commands should retrieve and execute the Gitblit image and launch Gitblit in a Docker container that serves the web ui on ports 80 and 443. Your repositories will also be accessible via ssh, http, https, and the git procotol. The RPC administration interface has also been enabled so that you may use the Gitblit Manager to configure settings, manage repositories, or manage users.
15+
The followings commands should retrieve and execute the Gitblit image and launch Gitblit in a Docker container that serves the web UI on ports 8080 and 8443. Your repositories will also be accessible via ssh, http, https, and the git procotol. The RPC administration interface has also been enabled so that you may use the Gitblit Manager to configure settings, manage repositories, or manage users.
2016

21-
You should be able to browse to http://localhost or https://localhost and login as `admin/admin`.
17+
You should be able to browse to http://localhost:8080 or https://localhost:8443 and login as `admin/admin`.
2218

2319
You can stop your container with:
2420
```
25-
sudo docker.io stop gitblit
21+
sudo docker stop gitblit
2622
```
2723

2824
You can manually start your container with:
2925
```
30-
sudo docker.io start gitblit
26+
sudo docker start gitblit
3127
```
3228

3329
## Build Instructions
@@ -41,10 +37,10 @@ git clone https://github.com/gitblit/gitblit-docker.git
4137
### Build your Docker container
4238
```
4339
cd gitblit-docker
44-
sudo docker.io build -t jmoger/gitblit:1.6.2 .
40+
sudo docker build -t my-gitblit - < Dockerfile
4541
```
4642
### Run your Gitblit container and setup localhost port-forwarding (*-p localhost:container*)
4743
```
48-
sudo docker.io run -d --name gitblit -p 443:443 -p 80:80 -p 9418:9418 -p 29418:29418 jmoger/gitblit:1.6.2
44+
sudo docker run -d --name gitblit -p 8443:8443 -p 8080:8080 -p 9418:9418 -p 29418:29418 my-gitblit
4945
```
5046

0 commit comments

Comments
 (0)