1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

JenkinsをDockerで立ち上げる

1
Posted at

DockerでJenkinsサーバーを立ち上げる

適当な作業用フォルダ(例: jenkins-test)を作成し、その中に以下の docker-compose.yml を作成します。

docker-compose.yml
services:
  jenkins:
    image: jenkins/jenkins:lts
    ports:
      - '8080:8080' # Web画面・API用(人間・外部システム向け)
      - '50000:50000' # エージェント通信用(Jenkins内部の分散処理向け)
    volumes:
      - jenkins_home:/var/jenkins_home
    restart: on-failure

volumes:
  jenkins_home:

ファイルを作成したら、以下のコマンドで起動します。
起動には少し時間(1〜2分)がかかります。ブラウザで http://localhost:8080 にアクセスし、Jenkinsの画面が表示されれば成功です。

docker compose up -d

Jenkinsの初期パスワードを取得する

初期設定画面が表示されたら、Administrator password(初期パスワード)を求められます。
ターミナルで以下のコマンドを実行し、表示されたパスワードをコピーして貼り付けてください。

docker compose exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword

 
以上です。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?