Requirements
============

- GNU Make
- Python (>= 3.3)
- Docker
- Docker Compose

Quick start on Ubuntu 18.04 host
================================

1. Install Docker.
   See https://docs.docker.com/engine/install/ubuntu/ for details.

$ sudo apt-get update
$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository \
    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

2. Install Docker Compose.
   See https://docs.docker.com/compose/install/ for details.

  # specify the appropriate version.
  # cf. https://github.com/docker/compose/releases/latest
$ VER=1.24.0
$ curl -L \
    "https://github.com/docker/compose/releases/download/${VER}/docker-compose-$(uname -s)-$(uname -m)" \
    -o docker-compose \
  && sudo mv docker-compose /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose

3. Install other packages.

$ sudo apt install make git

4. Checkout gfarm2fs.

$ cd path/to/gfarm-src-top
$ git clone git@github.com:oss-tsukuba/gfarm2fs.git

5. Use Docker

$ cd docker/dev
$ editor config.mk
  # override GFDOCKER_IP_VERSION, GFDOCKER_SUBNET, and GFDOCKER_START_HOST_ADDR
  # from config-default.mk
$ cd dist/centos7/src  # when using source package on CentOS 7
  # note: execute 'sudo' in Makefile
$ make help  # display usage.
$ make reborn  # up the containers.
$ make shell  # enter the container.
$ make regress  # execute regress.
$ make down  # down the containers.

Keep keys
=========

1. to keep ssh host keys only for client1 container

  $ cd dist/centos7/src  # when using source package on CentOS 7
  $ make shell
  ### in container
  user1$ sudo ./SAVE_SSH_HOST_KEYS.sh

  Note: These keys are used next time in all distributions.

2. to add your ssh public keys to authorized keys only for user*@client1

  $ cd docker/dev
  $ sudo editor mnt/ssh_authorized_keys  # add your public keys

  $ cd dist/centos7/src  # when using source package on CentOS 7
  $ make reborn

  ### use "ssh" instead of "make shell"
  $ ssh user2@192.168.224.18  # IP addresss of client1 container

Note
====

- Do not edit .shadow.config.mk, docker-compose.yml, and common/rc.gfservice.
