LoginSignup
1
1

More than 5 years have passed since last update.

Gitbucket-docker を Raspberry Pi3で動かす

Last updated at Posted at 2018-04-20

Github 互換のソフトウェアである gitbucketをラズパイ上のdockerで動かしてみます。実は Dockerfileを書こうとしたら、作者の takezoeさんが gitbucket-dockerを作成していました。そこで、gitbucketのリリースを最新版にして docker-compose用のファイルを作成するだけで動かすことができています。

参考: Raspberry Pi用docker-composeの構築

1. Dockerファイルの作成

元々のgithub-dockerの Base Image をラズパイ用にして、Gitbucketのリリースを最新版の4.23.1にしているだけです。

FROM arm32v7/openjdk:10-jre

ADD https://github.com/gitbucket/gitbucket/releases/download/4.23.1/gitbucket.war /opt/gitbucket.war

RUN ln -s /gitbucket /root/.gitbucket

VOLUME /gitbucket

# Port for web page
EXPOSE 8080

# Port for SSH access to git repogitory (Optional)
EXPOSE 29418

CMD [ "java", "-jar", "/opt/gitbucket.war"]

2. gitbucket-dockerのビルド

以下のようにしてビルドしておきます。

docker build -t arm32v7/gitbucket .

3. docker-compose.yml の作成

例えば、こんな感じになります。

version: '3.1'

services:

  gitbucket:
    image: arm32v7/gitbucket
    restart: always
    ports:
      - 8080:8080
      - 29418:29418
    volumes:
      - /mnt/gitbucket/data:/gitbucket

ここでは、ラズパイに HDD を /mnt としてマウントしている想定です。

4. gitbucket の起動

docker-compose で起動します。

docker-compose up -d

5. ブラウザからのアクセス

ポート番号 8080 を指定していますので、ブラウザから http://<ホスト名>:8080/ のようにしてアクセスします。初回のログインでは、ユーザー root パスワード rootとなっていますので。パスワードを変更しておきましょう。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1