テンプレートテスト
ブログの説明
ブログの説明2
menu
keyboard_arrow_up
Top
search
close
home
ホーム
computer
PC一般
construction
開発環境・ツール
code
プログラミング
home
ホーム
computer
PC一般
construction
開発環境・ツール
code
プログラミング
ラベル
Docker
の投稿を表示しています。
すべての投稿を表示
ラベル
Docker
の投稿を表示しています。
すべての投稿を表示
2021/05/24
image
NO IMAGE
Rocket.Chat のバックアップとリストア
update
event_note
label
Docker
label
rocketchat
docker 上で動かしている Rocket.Chat のバックアップとリストア方法です。
## 環境 - Windows 10 - Docker Desktop 3.3.3 ## バックアップ docker コンテナ内で以下のコマンドを実行するだけです。 ``` $ mongodump --db rocketchat --out /tmp/rocketchat_backup ``` `--db` でデータベース名を指定し、`-out` で出力先を指定します。 ## リストア docker コンテナ内で以下のコマンドを実行するだけです。 ``` $ mongorestore --db rocketchat /tmp/rocketchat_backup/rocketchat/ --drop ``` あとは Rocket.Chat を再起動したら OK です。
## 参考 URL - https://blog.clarus.jp/posts/mongodb-backup-and-restore/
Read more
2021/05/21
image
NO IMAGE
Rocket.Chat を docker で動かす
update
event_note
label
Docker
label
rocketchat
公式の Rocket.Chat の Docker イメージを使って動かしてみましたが、結構苦労したのでメモしておきます。
## 環境 - Windows 10 - Docker Desktop 3.3.3 ## docker-compose.yml Rocket.Chat と MongoDb は docker-compose を使って起動しました。 以下、記述例です。 ``` version: '2' services: rocketchat: container_name: rocketchat image: rocketchat/rocket.chat:latest command: > bash -c "for i in `seq 1 30`; do node main.js && s=$$? && break || s=$$?; echo \"Tried $$i times. Waiting 5 secs...\"; sleep 5; done; (exit $$s)" restart: unless-stopped volumes: - uploads:/app/uploads depends_on: - mongo ports: - 3000:3000 environment: - PORT=3000 - ROOT_URL=http://localhost:3000 - MONGO_URL=mongodb://mongo:27017/rocketchat - MONGO_OPLOG_URL=mongodb://mongo:27017/local - TZ=Asia/Tokyo mongo: container_name: rocketchat-mongo image: mongo:4.0 restart: unless-stopped volumes: - db:/data/db - dump:/dump command: mongod --smallfiles --oplogSize 128 --replSet rs0 volumes: uploads: db: dump: ``` ## 起動後にすること ここが一番はまったところですが、docker-compose で起動するだけではアクセスできず、mongoDb でレプリカの登録を行ったらアクセスできるようになりました。 - 参考 - https://garafu.blogspot.com/2018/03/mongodb-init-or-change-replicaset-config.html - https://kakts-tec.hatenablog.com/entry/2017/06/21/000936 まず mongodb のコンテナに入ります。 ``` $ docker exec -it rocketchat-mongo bash ``` mongodb に接続します。 ``` $ mongo --host localhost:27017 ``` レプリカを登録します。 ``` > rs.initiate({ _id: "rs0", members: [ { _id: 0, host: "localhost:27017" } ]}) ``` スレーブを許可?します。 ``` > rs.slaveOk() ``` 終了します。 ``` > exit ``` これで docker-compose 再起動後に Rocket.Chat にアクセスできました。
## 参考 URL - https://garafu.blogspot.com/2018/03/mongodb-init-or-change-replicaset-config.html - https://kakts-tec.hatenablog.com/entry/2017/06/21/000936
Read more
2021/05/18
image
NO IMAGE
Redmine のアップデートとリストア
update
event_note
label
Docker
label
Redmine
会社で Redmine の環境を移行することになったので、そのメモです。
## 概要 - 現在の Redmine が 3.4.2 なので、移行ついでにアップデートする - 移行先では docker 上で Redmine を動作させる - DB は MySQL ## 事前準備 まずは現在使用しているプラグインなどが、最新の Redmine で動作するかをチェックしておきます。 具体的には、docker で各バージョンの Redmine を起動し、プラグインをインストールして使えるかを逐一チェックしていきました。 こんなの docker 使わないとやってられんね。 んで、調査の結果、現在の最新の 4.2 では動作しないプラグインがあったので、それが動作する 4.0 にアップデートすることにしました。 ## 移行の流れ 1. 移行先となる Redmine 4.0.9 を docker で起動 1. 移行元の Redmine 3.4.2 のバックアップファイルをもとにリストアする 1. プラグインとテーマのインストール 1. DB のマイグレーションを行う ### Dockerfile の作成 公式の Redmine の docker イメージをそのまま使いたかったですが、社内の諸事情(主に証明書とかプロキシ関連)により Dockerfile を作成しました。 その際、`unzip` があるとプラグインのインストールが楽なので追加しておきました。 ``` FROM redmine:4.0.9 # 中略 RUN apt -y install unzip ``` そして、ここでは適当に `myredmine` という名前でイメージを作成しました。 ``` $ docker build -t myredmine:4.0.9 . ``` ### docker-compose.yml の作成 Redmine と MySQL を簡単に起動できるよう、docker-compose を使いました。 例えば以下のような感じです。 ```yml version: '3.1' services: redmine: image: myredmine:4.0.9 container_name: myredmine restart: always depends_on: - mysql ports: - 3000:3000 environment: REDMINE_DB_MYSQL: mysql REDMINE_DB_PASSWORD: example volumes: - files:/usr/src/redmine/files mysql: image: mysql:5.7 container_name: redmine-mysql command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci restart: always environment: MYSQL_ROOT_PASSWORD: example MYSQL_DATABASE: redmine volumes: - mysql:/var/lib/mysql volumes: files: mysql: ``` ### リストア docker-compose を使って Redmine を起動したら、リストアを行います。 例えば以下のような感じです。 ここでは DB のバックアップファイルが `redmine_db_backup`、添付ファイルバックアップフォルダが `redmine_files` です。 ``` docker cp redmine_db_backup redmine-mysql:/ docker exec redmine-mysql bash -c "mysql -u root -pexample redmine < redmine_db_backup" docker cp redmine_files/. myredmine:/usr/src/redmine/ ``` ### プラグインとテーマのインストール github などからクローンできるものはコンテナ内で直接クローンします。 クローンできないものはあらかじめ適宜ダウンロードしておき、コンテナ内にコピーして展開しました。 例えば、以下のように、ホスト側で実行する `install_plugins.sh` と、その中で、コンテナ内で実行する `install_plugins_run.sh` を作成しました。 **install_plugins.sh** ``` #!/bin/bash # github から clone できないプラグインをコンテナ内にコピー docker cp redmine_checklists-3_1_18-light.zip myredmine:/usr/src/redmine # コンテナ内で実行するシェルスクリプトをコンテナ内にコピー docker cp install_plugins_run.sh myredmine:/usr/src/redmine # 実行 docker exec myredmine bash /usr/src/redmine/install_plugins_run.sh exit 0 ``` **install_plugins_run.sh** ``` #!/bin/bash # docker コンテナ内で実行するシェルスクリプト # github から clone してくる git clone --depth 1 https://github.com/koppen/redmine_github_hook ./plugins/redmine_github_hook # クローンできないものはあらかじめダウンロードして、ホストからコンテナにコピーしておく # ここでは展開するだけ unzip redmine_checklists-3_1_18-light.zip -d ./plugins # テーマのインストール(Redmine のバージョンに合わせたものをクローン) git clone --depth 1 https://github.com/makotokw/redmine-theme-gitmike.git public/themes/gitmike -b v1.1.1 exit 0 ``` ### マイグレーション 以下をコンテナ内で実行するだけです。 上記の `install_plugins_run.sh` の中に含めてもいいかもしれません。 ``` export RAILS_ENV=production bundle update bundle exec rake db:migrate bundle exec rake redmine:plugins:migrate RAILS_ENV=production bundle exec rake tmp:clear ``` あとは Redmine を再起動すれば完了です。
## 参考 URL - https://netazone.net/archives/3747/
Read more
2021/04/22
image
NO IMAGE
ruby の gem install で SSL のエラーが発生する
update
event_note
label
Docker
label
Redmine
label
Ubuntu
Redmine をプラグインのインストールまで自動化して docker で動かそうとしたら、ruby の gem install で SSL 関係のエラーが出て、かなりはまってしまいました。
試しに作成した Redmine 用の `Dockerfile` と `docker-compose.yml` の例は以下です。 Windows (WSL2 + Docker Desktop) だと上手くいきましたが、Ubuntu 20.04 だと `bundle install` で証明書関係のエラーが出ました。 ``` FROM redmine:4.2 # Git SSL認証チェックを無効にする ENV GIT_SSL_NO_VERIFY=1 # プロキシ設定 ENV http_proxy=http://example:8080 ENV https_proxy=http://example:8080 # プラグインのダウンロード RUN git clone --depth 1 https://github.com/pinzolo/redmine_persist_wfmt ./plugins/redmine_persist_wfmt ``` ``` version: '3.1' services: redmine: image: myredmine:4.2 build: . container_name: myredmine restart: always depends_on: - mysql ports: - 3000:3000 environment: REDMINE_DB_MYSQL: mysql REDMINE_DB_PASSWORD: example REDMINE_PLUGINS_MIGRATE: "true" http_proxy: http://example:8080 https_proxy: http://example:8080 volumes: - files:/usr/src/redmine/files mysql: image: mysql:5.7 container_name: redmine-mysql command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci restart: always environment: MYSQL_ROOT_PASSWORD: example MYSQL_DATABASE: redmine http_proxy: http://example:8080 https_proxy: http://example:8080 volumes: - mysql:/var/lib/mysql volumes: files: mysql: ``` `docker-compose up` を実行すると以下のエラーが出て止まりました。 ``` myredmine | Bundler can't satisfy your Gemfile's dependencies. myredmine | Install missing gems with `bundle install`. myredmine | The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`. myredmine | The dependency ffi (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`. myredmine | Fetching source index from https://rubygems.org/ myredmine | Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/ ``` ググると、最新の証明書をインストールしたら解決する的な記事が見つかります。 - https://the-oreno-michi.com/72/ - https://qiita.com/hirokishirai/items/7579eaad5132a8e48975 - https://qiita.com/saya9875/items/b911b26f3b3a1b970d2f しかし、私の場合これらでは解決せず、証明書関係をいろいろ見直しても解決せず、途方に暮れていたところ、以下の記事で解決しました。 - https://askubuntu.com/questions/1231799/certificate-error-after-upgrade-to-20-04 会社のプロキシ環境下で環境を構築しているのですが、Ubuntu 20.04 では CA 証明書の要求バージョンが上がっており、会社の証明書じゃ弱すぎるためにエラーが出ているっぽいです。 そして、openssl の設定を上記の記事のように変更すると一応回避可能なのですが、それだけではなく、Redmine の docker コンテナ内でも同じように openssl の設定を変更することで、やっとエラーが表示されなくなりました。 いや、めっちゃはまったわ~。
## 参考 URL - https://askubuntu.com/questions/1231799/certificate-error-after-upgrade-to-20-04
Read more
2021/04/21
image
NO IMAGE
WSL2 で動かしている Docker Desktop が重い
update
event_note
label
Docker
タイトルの通りで、ちょっとコマンド打っただけでもレスポンスが遅い。
どうやら Windows 上で実行するとファイルシステムの変換が発生するから遅いそうです。 - https://qiita.com/BlueBaybridge/items/c1adcf1dab5da2b40b4f 確かに、WSL2 上ではサクサクでした。 というわけで、WSL2 と Docker Desktop を使う場合、記事のとおり `Dockerfile` や `docker-compose.yml` は WSL 側に配置して、Visual Studio Code と Remote-WSL を使うのが良いですね。
## 参考 URL - https://qiita.com/BlueBaybridge/items/c1adcf1dab5da2b40b4f
Read more
2019/12/27
Docker Desktop for Windows のデータの格納場所を変更(移動)する
update
event_note
label
Docker
Docker Desktop for Windows はデフォルトでは C ドライブにデータを格納しますが、これを別のドライブに移動させました。
## 環境 - Windows 10 - Docker Desktop for Windows 2.1.0.5 ## 移動先にフォルダを作成する 移動先に Docker のデータを格納するためのフォルダを作成しておきます。 今回は D ドライブに `DockerVM` というフォルダを作成しました。 ## Hyper-V の設定を変更する スタートメニューから `Hyper-V マネージャー` を起動し、`DockerDesktopVM` の仮想マシンを右クリックして `移動` を選択します。
ウィザードを次へ進んでいき、仮想マシンの新しい場所で、先ほど作成したフォルダ(ここでは `D:\DockerVM\`)を指定します。
次へ進むとデータの移動が開始されます。 ## Docker Desktop for Windows の設定を変更する タスクバーの Docker アイコンを右クリックし、`Settings` を選択します。 `Advanced` の `Disk image location` で、先ほど作成したフォルダ内の `Virtual Hard Disks` (ここでは `D:\DockerVM\Virtual Hard Disks`)を選択します。
すると、`Disk image location` に選択したフォルダ内の `DockerDesktop.vhdx` が指定された状態になります。
`Apply` を押すと Docker が再起動し、完了です。
## 参考 URL - https://rightech.jp/2019/06/28/docker-desktop-for-windows-change-disk-location/ - https://aulta.co.jp/archives/6785
Read more
2019/11/02
Redmine のバックアップとリストア
update
event_note
label
Docker
label
Redmine
Docker 上で動かしている Redmine のバックアップとリストアを行いましたので、その手順をまとめておきます。
## 環境 - Docker for Windows - Redmine 3.4.5 DB は MySQL を使用しています。 ## バックアップ ### MySQL のバックアップ MySQL のバックアップを行うコマンドは以下です。 ```sh mysqldump -u MySQLユーザー名 -pMySQLパスワード Redmineデータベース名 > バックアップファイル名 ``` 例えば以下のような感じです。 ```sh mysqldump -u root -ppassword redmine > redmine.sql ``` 今回は docker で Redmine を動かしているので、以下のように `docker exec` で実行します。 ```sh docker exec MySQLのコンテナ名 bash -c "mysqldump -u MySQLユーザー名 -pMySQLパスワード Redmineデータベース名" > バックアップファイル名 ``` 例えば以下のような感じです。 ```sh docker exec redmine-mysql bash -c "mysqldump -u root -ppassword redmine" > redmine.sql ``` 上記のコマンドを実行すると、`docker exec` を実行したホストのディレクトリにバックアップファイルが作成されます。 ### 添付ファイルのバックアップ 添付ファイルは `/usr/src/redmine/files` にあり、これをコピーすればいいだけなので、`docker cp` でコンテナからホストにコピーします。 ```sh docker cp Redmineのコンテナ名:/usr/src/redmine/files コピー先 ``` 例えば以下のような感じです。 ```sh docker cp redmine:/usr/src/redmine/files ./ ``` ## リストア ### MySQL のリストア リストアを行うコマンドは以下です。 ``` mysql -u MySQLユーザー名 -pMySQLパスワード Redmineデータベース名 < バックアップファイル名 ``` 例えば以下のような感じです。 ```sh mysql -u root -ppassword redmine < redmine.sql ``` 今回は docker で Redmine を動かしているので、バックアップと同じように `docker exec` で実行します。 ※ちょっと上手くいかなかったので、バックアップファイルを一度ホストからコンテナにコピーしてからリストアを行いました。 ```sh docker cp バックアップデータ MySQLのコンテナ名:コピー先 docker exec MySQLのコンテナ名 bash -c "mysql -u MySQLユーザー名 -pMySQLパスワード Redmineデータベース名 < バックアップファイル名" ``` 例えば以下のような感じです。 ```sh docker cp redmine.sql redmine-mysql:/ docker exec redmine-mysql bash -c "mysql -u root -ppassword redmine < redmine.sql" ``` ### files のリストア 添付ファイルはバックアップしたデータを `/usr/src/redmine/files` にコピーすればいいだけなので、`docker cp` でホストからコンテナにコピーします。 ```sh docker cp バックアップデータ Redmineのコンテナ名:/usr/src/redmine/ ``` 例えば以下のような感じです。 ```sh docker cp files/. redmine:/usr/src/redmine/ ``` `/.` をつけるとディレクトリの中身だけがコピーされます。
## 参考 URL - http://redmine.jp/faq/system_management/backup/ - http://dupont-kedama.blogspot.com/2014/02/powershellmysqlexesql.html
Read more
2019/06/19
image
NO IMAGE
InfluxDB を docker-compose で動かしてみる
update
event_note
label
Chronograf
label
Docker
label
Grafana
label
InfluxDB
時系列データベースの InfluxDB を使ってみたかったので、docker-compose を使って試してみました。まぁよくあるやつです。
## 環境 - Docker for Windows 2.0.0.3 - InfluxDB 1.7.6 ### UI について InfluxDB 1.3 以降、Web UI はサポートされなくなったようです。 (Docker コンテナを起動してもアクセスできず、何故だろうとちょっとはまってしまった・・・) その代わり、InfluxDB 専用の可視化ツールとして Chronograf というのが提供されているようです。 他には Grafana などがよく使われるようですね。 ## docker-compose.yml `docker-compose.yml` のサンプルです。 可視化ツールとして Chronograf と Grafana の両方を設定していますが、普通はどちらかしか使わないと思うので、必要に応じて使わないほうを削除してください。 ```yml version: '3.1' services: influxdb: container_name: influxdb image: influxdb ports: - "8086:8086" volumes: - influxdb:/var/lib/influxdb chronograf: container_name: chronograf image: chronograf ports: - "8888:8888" links: - influxdb volumes: - chronograf:/var/lib/chronograf grafana: container_name: grafana image: grafana/grafana links: - influxdb ports: - "3000:3000" volumes: - grafana:/var/lib/grafana volumes: influxdb: chronograf: grafana: ``` InfluxDB へのデータ読み書きや、可視化ツールの使い方については別途記事を書こうと思います。 - [[C#] InfluxDB へのデータ書き込み](https://kuttsun.blogspot.com/2019/06/influxdb-net.html) - [Chronograf を使ってみた](https://kuttsun.blogspot.com/2019/06/chronograf.html) ## InfluxDB へ接続できない場合 私の場合ですが、`docker-compose.yml` で links で各サービスを関連付けていたので、Chronograf や Grafana で InfluxDB へ接続する場合は、localhost などではなく、Docker のコンテナ名で指定しないと繋がりませんでした。
## 参考 URL - https://qiita.com/tukiyo3/items/2037a7da02eb29307764 - https://qiita.com/chroju/items/355f3c6da9f8c4867ba5 - https://blue1st-tech.hateblo.jp/entry/2016/07/04/014614 - https://kapibara-sos.net/archives/698 - https://hawksnowlog.blogspot.com/2017/08/first-chronograf-on-macos.html - https://qiita.com/kanegoon/items/5ade64336d389feea4bc
Read more
2019/04/11
image
NO IMAGE
DokuWiki を docker-compose で動かしてみる
update
event_note
label
Docker
label
DokuWiki
PukiWiki から DokuWiki に移行することになったのですが、その DokuWiki を docker-compose を使って動作させてみました。
Docker イメージは出来るだけ公式なものを使いたいので、[Bitnami DokuWiki](https://github.com/bitnami/bitnami-docker-dokuwiki) を使用します。 ## docker-compose.yml とりあえず作成した `docker-compose.yml` は以下です。 ```yml version: '3' services: dokuwiki: container_name: dokuwiki image: bitnami/dokuwiki:latest restart: unless-stopped ports: - 11080:80 - 11443:443 environment: DOKUWIKI_USERNAME: admin DOKUWIKI_PASSWORD: admin http_proxy: http://example.com:8080 https_proxy: http://example.com:8080 volumes: - data:/bitnami networks: - common networks: common: external: true volumes: data: ``` ネットワークに関しては、あらかじめ `common` というネットワークを作成して使用しています。
## 参考 URL - https://github.com/bitnami/bitnami-docker-dokuwiki
Read more
2019/03/20
image
NO IMAGE
CentOS に Docker をインストールする
update
event_note
label
Docker
以下のページが参考になりました。
Docker のインストール - http://hirosanote.hatenablog.jp/entry/2018/06/18/204048 wget のプロキシ設定 - https://qiita.com/katsuta/items/17eee8e78543871b5f27 Docker のプロキシ設定 - https://qiita.com/KuwabataK/items/a33c625d1472b0ab2e16
Read more
2018/11/28
image
NO IMAGE
docker build で connect: no route to host が表示された
update
event_note
label
Docker
docker build を行った際に以下のようなエラーが表示されました。
``` ERROR: Service 'hoge' failed to build: Get https://registry-1.docker.io/v2/: proxyconnect tcp: dial tcp xxx.xxx.xxx.xxx:8080: connect: no route to host ``` 原因は、`docker network create` で作ったネットワークとアドレスが被っていたことでした。
## 参考 URL - https://qiita.com/take4s5i/items/db018ef6d8e4bbd10639
Read more
2017/12/06
image
NO IMAGE
SonarQube を docker-compose で動かしてみる
update
event_note
label
Docker
label
SonarQube
C# で作成したアプリケーションの静的解析を行うために、SonarQube をインストールしてみました。
尚、いつもの通り Docker を使ってインストールします。 (Docker に慣れてくると全て Docker で構築したくなってきます。) ## 環境 - Docker for Windows ## docker-compose.yml 作成した `docker-compose.yml` は以下のような感じです。 SonarQube は公式のイメージがあるのでそれを使用します。 ```sh version: '2' services: sonarqube: image: sonarqube container_name: sonarqube restart: always ports: - 9000:9000 environment: - SONARQUBE_JDBC_URL=jdbc:postgresql://sonarqube_db:5432/sonar volumes: - conf:/opt/sonarqube/conf - data:/opt/sonarqube/data - extensions:/opt/sonarqube/extensions - bundled-plugins:/opt/sonarqube/lib/bundled-plugins sonarqube_db: image: postgres container_name: sonarqube_db restart: always environment: - POSTGRES_USER=sonar - POSTGRES_PASSWORD=sonar volumes: - postgresql:/var/lib/postgresql # This needs explicit mapping due to https://github.com/docker-library/postgres/blob/4e48e3228a30763913ece952c611e5e9b95c8759/Dockerfile.template#L52 - postgresql_data:/var/lib/postgresql/data volumes: conf: data: extensions: bundled-plugins: postgresql: postgresql_data: ``` ## 管理者でログイン 起動したら以下の管理者 ID でログインできます。 - Username : admin - Password : admin ## SonarQube の設定 SonarQube の設定は `/opt/sonarqube/conf/sonar.properties` に記述します。 ### プロキシの設定 プロキシ環境下ではプロキシ設定を行っておかないとプラグインのインストールなどができません。 - https://docs.sonarqube.org/display/SONAR/Marketplace `sonar.properties` の以下の行のコメントアウトを解除して設定します。 ```sh # HTTP proxy (default none) http.proxyHost=xxx.xxx.xxx.xxx http.proxyPort=8080 # HTTPS proxy (defaults are values of http.proxyHost and http.proxyPort) https.proxyHost=xxx.xxx.xxx.xxx https.proxyPort=8080 ``` ### LDAP 認証の設定 社内の Active Directory で LDAP 認証を行うための設定を行います。 まずは LDAP Plugin をインストールします。 プロキシ設定を適切に行っていれば [Administration] > [Marketplace] からインストールできます。 - https://docs.sonarqube.org/display/PLUG/LDAP+Plugin `sonar.properties` に以下を追記します。 内容は環境に応じて適宜変更します。 ```sh # LDAP sonar.security.realm=LDAP ldap.url=ldap://example.com:389 ldap.bindDn=hoge@example.com ldap.bindPassword=xxxxxxxx ldap.user.baseDn=dc=example,dc=com ldap.user.request=(&(objectClass=user)(sAMAccountName={login})) ldap.user.realNameAttribute=cn ldap.user.emailAttribute=mail ``` ### SMTP の設定 管理者アカウントでログインします。 [Administration] > [Configuration] > [General] の [Email] で設定します。 ## 参考 URL - https://qiita.com/ot-aoyagi/items/d97b2431fefbf5635e93 - https://qiita.com/teradonburi/items/776e4735395af872320a - https://qiita.com/yo1000/items/0af36c8bc5e944c1e42a - https://github.com/SonarSource/docker-sonarqube/blob/master/recipes.md - https://qiita.com/okamu_/items/1c8e5fde742ca165fa12#sonarqube - http://blog.applibot.co.jp/blog/2017/09/14/static-code-analysis-with-sonarqube/
Read more
2017/10/23
image
NO IMAGE
TestLink を docker-compose で動かしてみる
update
event_note
label
Docker
label
TestLink
オープンソースのテスト管理ツール TestLink を docker-compose で動かしてみます。 Docker イメージは出来るだけ公式なものを使いたいので、[Bitnami TestLink](https://hub.docker.com/r/bitnami/testlink/) を使用します。
Docker は Docker for Windows を使っています。 なので、マウントするホストのボリュームが Windows になっています。 ## docker-compose.yml とりあえず作成した docker-compose.yml は以下です。 ```yml version: '2' services: mariadb: image: bitnami/mariadb container_name: testlink-mariadb restart: always environment: - ALLOW_EMPTY_PASSWORD=yes volumes: - C:\Docker\testlink\mariadb_data:/bitnami testlink: image: bitnami/testlink container_name: testlink restart: always ports: - '3080:80' - '443:443' volumes: - C:\Docker\testlink\testlink_data:/bitnami depends_on: - mariadb environment: - TESTLINK_USERNAME=admin - TESTLINK_PASSWORD=admin - TESTLINK_EMAIL=testlink@example.com - SMTP_ENABLE=true - SMTP_HOST=smtp.example.com - SMTP_PORT=25 ``` 使用できる環境変数は[こちら](https://hub.docker.com/r/bitnami/testlink/)に書いてありますが、とても少ないです。 ## 参考 URL - https://hub.docker.com/r/bitnami/testlink/ - https://qiita.com/shimizumasaru/items/0fd6a271f123d77ee2ad
Read more
2017/10/17
image
NO IMAGE
Docker である日突然 pull できなくなった
update
event_note
label
Docker
Docker を使っていたら、ある日突然 pull できなくなりました。 それまでは普通に使えていたのに。
エラー内容は以下でした。 ``` ERROR: Get https://registry-1.docker.io/v2/: proxyconnect tcp: dial tcp xxx.xxx.xxx.xxx: getsockopt: no route to host ``` ググってみたところ、どうやらネットワークの問題のようです。 - https://qiita.com/take4s5i/items/db018ef6d8e4bbd10639 上記の記事にある通り、私は docker-compose しか使ってないので全く気が付きませんでした。 とりあえずは以下のコマンドを打てば解決しました。 ```sh > docker network prune ``` それでもダメな場合は、以下のように一時的に `docker-compose.yml` を修正して対応しました。 ```yml services: hoge: networks: - bridge1 piyo: networks: - bridge2 networks: bridge1: driver: bridge ipam: driver: default config: - subnet: 172.21.0.0/16 gateway: 172.21.0.1 bridge2: driver: bridge ipam: driver: default config: - subnet: 172.22.0.0/16 gateway: 172.22.0.1 ``` ## 参考 URL - https://qiita.com/take4s5i/items/db018ef6d8e4bbd10639 - http://srz-zumix.blogspot.jp/2017/06/docker-docker-compose-network.html
Read more
2017/10/13
Redmine を docker-compose で動かしてみる
update
event_note
label
Docker
label
Redmine
公式の Docker イメージを使用して Redmine を docker-compose で動かしてみます。
データベースは MySQL を使用します。 理由は、現在 Bitnami Redmine を使用しており、そこからの移行を目的としているためです。 ## docker-compose.yml とりあえず作成した docker-compose.yml は以下です。 ```yml version: '2' services: redmine: image: redmine restart: always ports: - 3000:3000 environment: - REDMINE_DB_MYSQL=mysql - REDMINE_DB_PASSWORD=example volumes_from: - redmine-datastore redmine-datastore: container_name: redmine-datastore image: busybox volumes: - /usr/src/redmine/files mysql: container_name: redmine-mysql image: mysql command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci restart: always environment: MYSQL_ROOT_PASSWORD: example MYSQL_DATABASE: redmine volumes_from: - mysql-datastore mysql-datastore: container_name: redmine-mysql-datastore image: busybox volumes: - /var/lib/mysql ``` 後述しますが、MySQL については文字コードを変更しないとエラーが表示されます。 ## MySQL の文字コードを変更 Redmine に管理者でログイン後、管理メニューでデフォルト設定がロードできますが、当初ここで以下のようなエラーが表示されました。
``` デフォルト設定がロードできませんでした: Mysql2::Error: Incorrect string value: ``` 調べたところ、これは MySQL の文字コードに起因しているようです。 なので、MySQL の文字コードを変更します。 docker-compose.yml の中の以下のコードが文字コードを変更している箇所です。 ```bat command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci ``` ## 参考 URL - https://hub.docker.com/_/redmine/ - http://simota.hatenablog.jp/entry/2016/07/03/000023 - https://qiita.com/nexkeh/items/02a4d6c33d884bda1b23 - https://www.ainoniwa.net/pelican/2016/1120a.html - https://blog.leko.jp/post/how-to-use-redmine-with-docker-in-japanese/ - https://qiita.com/neko-neko/items/de8ea13bbad32140de87 - https://qiita.com/astrsk_hori/items/1e683a7a2f2b7189cb6e - https://github.com/sameersbn/docker-redmine/blob/master/docker-compose.yml
Read more
2017/10/05
Docker for Windows の設定
update
event_note
label
Docker
Docker for Windows をインストールすれば、Docker のコマンドがコマンドプロンプトや PowerShell で使えるようになるので、Linux と同じように Docker を扱うことができるのですが、いくつか Windows ならではの設定や問題点などもあるようです。
## 設定画面 タスクバーの Docker アイコンを右クリックし、「Settings」をクリックします。
### プロキシ設定 設定画面より `Proxies` メニューを選択します。 `Manual proxy configuration` を選択し、プロキシサーバーの情報を入力し、`Apply` を選択します。 `Docker` が再起動します。 ### ドライブの共有 ホストのボリュームをコンテナにマウントしたい場合、あらかじめドライブを共有にしておく必要があります。 設定画面より `Shared Drive` メニューを選択します。 共有したいドライブにチェックを入れ、`Apply`を選択します。 Docker が再起動します。
Read more
2017/09/29
image
NO IMAGE
GitLab Runner を docker-compose で動かす
update
event_note
label
Docker
label
GitLab
GitLab で CI を行う場合、GitLab Runner があると便利なので、それを docker-compose で動かしてみます。
Docker イメージは Docker Hub で公開されています。 - https://hub.docker.com/r/gitlab/gitlab-runner/ ## 前提 当初、GitLab と GitLab Runner は Docker for Windows で同じホストで動作させる予定でした。 しかし、どうも GitLab Runner がジョブを開始しないので、GitLab Runner だけは CentOS で動作させることにしました。 CentOS だと何の問題もなく動作しました。 何故 GitLab も CentOS で動作させないのかというと、社内のネットワーク事情です。 ## docker-compose.yml の作成 設定は docker-compose を使って行います。 以下のような `docker-compose.yml` を作成しました。 ```yml version: '2' services: gitlab-runner: image: gitlab/gitlab-runner restart: always volumes: - /srv/gitlab-runner/config:/etc/gitlab-runner - /var/run/docker.sock:/var/run/docker.sock ``` docker-compose で起動します。 ```sh docker-compose up -d ``` ## 登録処理 gitlab-runner 起動後、コンテナの中に入って、登録処理を行います。 詳細は以下の記事を参考にしてください。 - [GitLab Runner を GitLab に登録](http://kuttsun.blogspot.jp/2017/10/gitlab-runner-gitlab.html) ## 参考 URL - https://docs.gitlab.com/runner/install/docker.html - https://qiita.com/toe/items/f47f383b9931a840a25c - https://docs.gitlab.com/runner/install/docker.html#docker-image-installation-and-configuration - https://about.gitlab.com/features/gitlab-ci-cd/ - https://qiita.com/toe/items/f47f383b9931a840a25c#gitlab-runner%E3%82%B3%E3%83%B3%E3%83%86%E3%83%8A%E3%82%92%E8%B5%B7%E5%8B%95%E3%81%99%E3%82%8B - http://blog.hawksnowlog.cf/2017/09/build-specific-runner-for-gitlabci.html#%E3%83%A9%E3%83%B3%E3%83%8A%E3%83%BC%E3%82%92%E7%99%BB%E9%8C%B2%E3%81%99%E3%82%8B - https://kore1server.com/353/GitLab+CI%E3%81%A8%E3%83%A9%E3%83%B3%E3%83%8A%E3%83%BC%E3%81%A7%E3%83%87%E3%83%97%E3%83%AD%E3%82%A4%E3%81%99%E3%82%8B
Read more
2017/09/26
image
NO IMAGE
PlantUML サーバーを docker-compose で動かす
update
event_note
label
Docker
label
PlantUML
GitLab で Markdown や Asciidoc を使ってドキュメント書く場合に、PlantUML を埋め込んで図を記述できるようにするために、Docker を使って PlantUML サーバーを立ててみました。
Docker イメージは Docker Hub で公開されています。 - https://hub.docker.com/r/plantuml/plantuml-server/ ## docker-compose.yml の作成 作成した `docker-compose.yml` は以下です。 ```yml plantuml-server: image: plantuml/plantuml-server restart: always ports: - "13080:8080" ``` あとは起動するだけです。 ```sh docker-compose up -d ``` 起動したら `http://localhost:13080/` にアクセスしてみます。
Read more
2017/09/22
Docker for Windows のインストール
update
event_note
label
Docker
会社支給の PC がやっと Windows 10 に変わったので、Docker for Windows をインストールしてみました。
## ダウンロードとインストール Docker for Windows は以下のサイトからダウンロードできます。 - https://docs.docker.com/docker-for-windows/install/ 選択するオプションなどはないので、特に悩むことなくインストールできます。 インストール完了後、一度サインアウトする必要があります。 ## 以下のエラーが発生した場合 私の場合、インストール完了後にいくつかエラーが発生しました。 ### Hyper-V feature is not enabled.
```bat Hyper-V feature is not enabled. Do you want to enable it for Docker to be able to work properly? Your computer will restart automatically. ``` この画面が表示された場合、Hyper-V が有効になっていないので、OK を押して有効にします。 PC を一度再起動します。 ### Hardware assisted virtualization and data execution protection must be enabled in the BIOS.
```bat An error occurred Hardware assisted virtualization and data execution protection must be enabled in the BIOS. ``` 画面のリンク先に書いてありますが、この画面が表示された場合、Hyper-V だけでなく仮想化も有効にする必要があります。 仮想化が有効になっているかどうかはタスクマネージャーで確認できます。
仮想化を有効にするためには BIOS 設定を変更する必要があります。 BIOS の設定変更方法は PC によって異なりますので、以下はあくまで一例です。 #### HP ProBook の BIOS 設定 1. PC が起動したら F10 を押します。 1. `Advanced` タブから `System Options` を選択します。 1. `Virtualization Technology (VTx)` のチェックボックスを ON にします。 1. 保存します。 ## 動作確認 Docker が正常に起動したら、コマンドプロンプトまたは PowerShell から以下のコマンドを入力して確認してみます。 ```sh > docker --version Docker version 17.06.2-ce, build cec0b72 ``` docker-compose も一緒にインストールされています。 ```sh > docker-compose --version docker-compose version 1.14.0, build c7bdf9e3 ```
Read more
2017/08/08
image
NO IMAGE
ownCloud を docker-compose で動かしてみる
update
event_note
label
Docker
label
ownCloud
ownCloud はオンラインストレージを作成できる OSS です。 docker-compose を使用して動作させてみました。
## ダウンロードとインストール 既にやっておられる方がいらっしゃったので、以下を参考に動作させてみました。 - http://qiita.com/takanemu/items/9a43b72f59309328f643 Docker Hub で配布されている公式の Docker イメージを使用していますが、それだと LDAP 認証を行うプラグインが見当たらなかったので、`owncloud/server` に変更しました。 ```yml postgres: image: postgres volumes: - "/opt/pg_data:/var/lib/postgresql/data" environment: POSTGRES_PASSWORD: password owncloud: image: owncloud/server ports: - "80:80" links: - postgres ``` LDAP 認証の設定方法についてはまた追々書きます。
Read more
前の投稿
ホーム
Translate
Popular Posts
ASP.NET Core で AdminLTE を使用する
TortoiseGit でコミットメッセージを変更する
image
NO IMAGE
TestLink で LDAP 認証を行う
image
NO IMAGE
[C#] Dictionary の キーがタプルの場合に JSON へのシリアライズとデシリアライズを行う方法
TortoiseGit でリモートリポジトリのタグを削除する
image
NO IMAGE
[C#] SonarQube で .NET アプリケーションのコード解析を行う
GitLab をアップグレードしたら Redmine へのリンクが解除された
image
NO IMAGE
ASP.NET Core (.NET Core) でバックグランドタスクを起動する
GitBucketのrootのパスワードを忘れたので再設定する
image
NO IMAGE
TortoiseGit のコンテキストメニューが消える
Labels
.NET Core
31
.NET Framework
17
.NET Standard
2
AdminLTE
1
Apache
3
AppVeyor
2
AsciiDoc
3
ASP.NET Core
55
Atom
4
AWS
2
AWS Cloud9
4
blockdiag
1
Blogger
10
Bootstrap
3
C/C++
6
C#
106
CentOS
3
Chrome
1
Chronograf
3
Codecov
1
CSS
1
Docker
28
DokuWiki
4
Doxygen
1
draw.io
1
Electron.NET
2
Entity Framework Core
9
Excel
2
FFmpeg
2
Firefox
5
Git
12
GitBook
4
GitBucket
7
GitHub
7
GitLab
30
Go
1
Google
1
Google Cloud Platform
1
Grafana
5
HTML
5
IIS
8
InfluxDB
6
JavaScript
7
Jenkins
7
Linux
25
Log4View
1
MahApps.Metro
3
MaterialDesignInXamlToolkit
1
MVC
1
MVVM
6
NLog
3
Node.js
3
npm
1
OpenSSL
3
ownCloud
2
Pine Script
1
PlantUML
5
PowerShell
7
Prism
2
Python
11
Razor
3
Redmine
30
remark.js
2
rocketchat
4
Ruby
3
SignalR
1
Socket.IO
1
SonarQube
5
Sphinx
10
SQL Server
5
SQLite
1
t
1
TestLink
2
Tomcat
2
TortoiseGit
10
TortoiseSVN
2
Trading View
1
Travis CI
1
Ubuntu
13
Visual Studio
39
Visual Studio Code
9
Vue.js
8
Windows
56
Windows 10
4
Windows ADK
1
Windows API
2
Windows Embedded
4
wkhtmltopdf
2
Word
3
WPF
12
WSL
1
Xamarin
1
xUnit
5
アプリケーション
1
デザインパターン
1
テスト
3
バッチファイル
2
ぴよ
3
プログラミング
3
ライセンス
1
ラベル
3
ラベル1
2
英語
2
雑記
1
書籍
1
数学
1
正規表現
1
Blog Archive
▼
2022
(1)
▼
2月
(1)
例えばボタンをクリックしたときに重い処理を実行する場合など、そのまま処理すると GUI が固まって...
►
2021
(24)
►
5月
(7)
►
4月
(8)
►
3月
(2)
►
2月
(2)
►
1月
(5)
►
2020
(60)
►
12月
(1)
►
11月
(3)
►
10月
(3)
►
9月
(3)
►
8月
(3)
►
7月
(7)
►
6月
(7)
►
5月
(2)
►
4月
(6)
►
3月
(6)
►
2月
(7)
►
1月
(12)
►
2019
(92)
►
12月
(13)
►
11月
(9)
►
10月
(3)
►
9月
(2)
►
8月
(3)
►
7月
(5)
►
6月
(11)
►
5月
(6)
►
4月
(17)
►
3月
(9)
►
2月
(6)
►
1月
(8)
►
2018
(100)
►
12月
(1)
►
11月
(11)
►
10月
(8)
►
9月
(6)
►
8月
(10)
►
7月
(10)
►
6月
(8)
►
5月
(9)
►
4月
(8)
►
3月
(14)
►
2月
(4)
►
1月
(11)
►
2017
(117)
►
12月
(14)
►
11月
(20)
►
10月
(17)
►
9月
(19)
►
8月
(10)
►
7月
(8)
►
6月
(3)
►
5月
(6)
►
4月
(5)
►
3月
(2)
►
2月
(8)
►
1月
(5)
►
2016
(91)
►
12月
(5)
►
11月
(9)
►
10月
(11)
►
9月
(9)
►
8月
(6)
►
7月
(14)
►
6月
(14)
►
5月
(11)
►
4月
(10)
►
3月
(2)
►
2015
(23)
►
12月
(4)
►
11月
(2)
►
10月
(8)
►
9月
(8)
►
7月
(1)
►
2013
(3)
►
11月
(1)
►
9月
(1)
►
7月
(1)
►
2012
(2)
►
7月
(1)
►
6月
(1)
►
2011
(1)
►
9月
(1)
►
2009
(1)
►
7月
(1)
►
2008
(2)
►
11月
(1)
►
7月
(1)
►
2007
(3)
►
10月
(3)