Skip to content
doronshai edited this page Sep 12, 2016 · 2 revisions
sudo sed -i '/ExecStart=\/usr\/bin\/dockerd/c\ExecStart=\/usr\/bin\/dockerd --storage-driver=devicemapper --storage-opt dm.datadev=\/dev\/thetaray\/docker-data --storage-opt dm.metadatadev=\/dev\/thetaray\/docker-metadata --storage-opt dm.use_deferred_removal=true --storage-opt dm.basesize=22G --log-opt max-size=50m' /usr/lib/systemd/system/docker.service

-i - for overwite the file without using nnew file
/c to change the whole line

sudo sed -i "/^ExecStart=/ s/$/ --insecure-registry ${docker_registry}/" /usr/lib/systemd/system/docker.service
http://stackoverflow.com/questions/9591744/add-to-the-end-of-a-line-containing-a-pattern-with-sed-or-awk1
    using " (double quotes) for using variables in sed