2

i just download ubuntu with

docker pull ubuntu:16.04

and then i want to install mysql and nginx inside them but has limited size

docker run -d -t --name temporary ubuntu:16.04
winpty docker exec -it temporary bash
df -h

and i got

root@90215dee6bc7:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay         991M  280M  711M  29% /
tmpfs           991M     0  991M   0% /dev
tmpfs           991M     0  991M   0% /sys/fs/cgroup
tmpfs           991M  280M  711M  29% /etc/hosts
shm              64M     0   64M   0% /dev/shm
tmpfs           991M     0  991M   0% /sys/firmware

how to increase that size?

i want to have 20GB size

my docker info :

Containers: 1
 Running: 1
 Paused: 0
 Stopped: 0
Images: 2
Server Version: 17.03.1-ce-rc1
Storage Driver: overlay2
 Backing Filesystem: tmpfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.13-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934 GiB
Name: moby
ID: 6HQT:YHNE:ITRU:5T2E:IVVR:7XX6:GO67:7RXP:MQB3:AZ35:IZLK:QQ6B
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 23
 Goroutines: 27
 System Time: 2019-07-30T03:05:52.0912243Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
kreamik
  • 131
  • 1
  • 4

1 Answers1

0

If it is for just one container that you are going to create, then:

docker create -it --storage-opt size=20G ubuntu:16.04 /bin/bash



If you want to increase the default base size for your storage driver, then:

dockerd --storage-opt dm.basesize=20G
  • Be sure to then restart your docker daemon systemctl restart docker and you can do the pull and run you were doing before.
user138278
  • 121
  • 3