1
0

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.

CoreOSでdockerのbasesizeをかえる。

Posted at

devicemapperのみ利用可能、overlay2 では使えないと思う。

##下準備
/var/lib/docker
を消す(データが消える)

##cloud init

cloud-config.ymlを作る
core20190325 core # vi cloud-config.yml
#cloud-config
coreos:
  units:
    - name: docker.service
      drop-ins:
        - name: 10-storage-opt.conf
          content: |
            [Service]
            Environment="DOCKER_OPTS=--storage-opt dm.basesize=1G"
      command: start

##読み込む

core20190325 core # coreos-cloudinit -from-file=./cloud-config.yml

あるいは

ls /etc/systemd/system/docker.service.d/
vi その中にあるファイル(e.g.10-devicemapper-storage-driver.conf)
[Service]
Environment="DOCKER_OPTS=  --storage-opt=dm.basesize=1G"

##リロード

core20190325 core # systemctl daemon-reload
core20190325 core #  systemctl stop docker

#たまに消さなくても動作しそうです。

core20190325 core # rm -rf /var/lib/docker

core20190325 core #  systemctl start docker
core20190325 core # docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 18.06.1-ce
Storage Driver: devicemapper
 Pool Name: docker-8:9-1042461-pool
 Pool Blocksize: 65.54kB
 Base Device Size: 1.074GB
 Backing Filesystem: xfs

#Ref
https://qiita.com/python_spameggs/items/66f6bbe4b97be55f8b65
https://coreos.com/os/docs/latest/customizing-docker.html
#See Also
https://qiita.com/haniokasai/items/2b7a1889e4930b7682c9

1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?