6
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

EclipseをインストールしたDockerイメージを作ってみた

Last updated at Posted at 2018-02-03

環境
Windows 10 Pro 1709(16299.192)
Docker version 17.12.0-ce, build c97c6d6
CentOS Linux release 7.4.1708 (Core)
MobaXterm Persomal Edition Build 3582
Eclipse Installer version: 1.7.0 Build 3059

前提

Dockerイメージ「centosjp」を元に、Eclipseをインストールした「dev_eclipse」イメージを作成します。
Dockerイメージ「centosjp」の作り方は、Window10に日本語対応CentOS7のdockerコンテナを作ってみたを参照。

0.「MobaXterm」をインストール

ドキュメントURL

ダウンロードURL

追加の設定(起動時ダイアログの抑制)

起動時に、ダイアログが表示される。
MobaXterm.png

表示されないように、X11 remote accessをFullにする。

  1. Settings->Configurationメニューを選択
    MobaXterm_config.png

  2. X11 remote accessをFullに設定
    MobaXterm_config_set.png

1.「Dockerfile」を作成

Dockerfile
FROM centosjp
LABEL maintainer "michiru <0ashina0@gmail.com>"

#キャッシュクリア
RUN yum clean all

#"Development and Creative Workstation"グループのインストール
RUN yum clean all
RUN yum -y install deltarpm
RUN yum -y groupinstall "Development and Creative Workstation"

#Eclipseダウンロード
RUN wget -q -O /tmp/eclipse-inst-linux64.tar.gz "https://www.eclipse.org/downloads/download.php?file=/oomph/epp/oxygen/R/eclipse-inst-linux64.tar.gz&mirror_id=1"
RUN tar xavf /tmp/eclipse-* -C /opt/
RUN ln -s /opt/eclipse-installer /usr/bin


2.「Dockerイメージ」devの作成(Eclipseインストール直前のイメージ)

PS C:\Users\UserName> docker build ./ -t dev

3.「Dockerコンテナ」の作成&起動

PS C:\Users\UserName> docker run -it -e DISPLAY=<ホストのIPアドレス>:0.0 dev

例) docker run -it -e DISPLAY=192.168.11.12:0.0 dev

ホストのIPアドレスは、ipconfigコマンドで確認できる。
以下の場合、192.168.11.12

PS C:\Users\UserName> ipconfig

xxxxxxxxx アダプター xxxxxxxxxx:

   接続固有の DNS サフィックス . . . . .: xxxx.xx.xx
   リンクローカル IPv6 アドレス. . . . .: 
   IPv4 アドレス . . . . . . . . . . . .: 192.168.11.12
   サブネット マスク . . . . . . . . . .: 255.255.255.0
   デフォルト ゲートウェイ . . . . . . .: 192.168.11.1
PS C:\Users\0ashi>

4.Eclipseのインストール

CentOS
[root@275f75a472cb ~]# /usr/bin/eclipse-installer/eclipse-inst

eclipse.png

Refer to Eclipse IDE Downloads

5.「Dockerイメージ」dev_eclipseの作成(Eclipseインストール後のイメージ)

docker commitで「Dockerイメージ」の作成する。

PS C:\Users\UserName> docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
275f75a472cb        dev                 "/bin/bash"         15 minutes ago      Up 15 minutes                           tender_poitras
PS C:\Users\UserName>  docker commit -m "Eclipse Installed"  275f75a472cb dev_eclipse

メモ

  1. yum -y groupinstall "Development and Creative Workstation"
    したときに、deltarpmが見つからないエラーが出たので、
    yum -y install deltarpmを追加した。

  2. CentOS上で起動した画面を表示するために、MobaXtermをインストール。また、CentOSのDISPLAY環境変数にWindowsのIPアドレスを指定する。
    docker run -it -e DISPLAY=<WindowsのIPアドレス>:0.0 dev_eclipse

  3. eclipse-cpp-neonのダウンロード
    wget "http://ftp.yz.yamagata-u.ac.jp/pub/eclipse/technology/epp/downloads/release/neon/3/eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz"

6
8
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
6
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?