Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run docker with experimental functions on Ubuntu 16.04

I have following question:

How to run docker with experimental features on (like image squashing docker build --squash=true... for reduce it size) on ubuntu 16.04 ?

like image 942
Kamil Kiełczewski Avatar asked Jun 03 '17 16:06

Kamil Kiełczewski


People also ask

How do I enable Docker experimental features in Ubuntu?

Docker experimental features can be enabled by adding an /etc/docker/daemon. json with {"experimental": true} on the Remote Docker instance and restarting the daemon. This can then be used from the Docker cli.

How do I enable Docker experimental?

To enable experimental features on the Docker daemon, edit the daemon. json and set experimental to true . Experimental features provide early access to future product functionality.


2 Answers

To turn on experimental docker functions create following file by:

sudo nano /etc/docker/daemon.json

and add below content to it

{      "experimental": true  }  

and save file (by CTRL+X and Enter ) and exit. In terminal type:

sudo service docker restart

To check that experimental funcions are ON, type in terminal:

docker version

And you should see Experimental: true

UPDATE

Instead of nano you can use this one-liner:

echo $'{\n    "experimental": true\n}' | sudo tee /etc/docker/daemon.json 
like image 192
Kamil Kiełczewski Avatar answered Sep 26 '22 10:09

Kamil Kiełczewski


I tried everything here on a Ubuntu 18.04 VM on my mac--nothing worked. All over the interwebs said the same thing, but the one thing that finally got experimental turned on was @Michael Haren's tiny answer:

fyi- to enable this for the client, the config file to create is ~/.docker/config.json and the value is "enabled", not true

which meant something like this for me:

$ mkdir ~/.docker $ echo '{ "experimental": "enabled" }' > ~/.docker/config.json $ sudo systemctl restart docker $ docker version   ...   Experimental: true   ... 

This should be a top-level answer. So, credit to them (except sweet internet karma points for me...).

like image 20
petemyron Avatar answered Sep 23 '22 10:09

petemyron