There is a convenience script which can be used to install and start docker using LCFS. You must first choose a device to install lcfs onto. lcfs requires a block device (you can also use a file, but this is not recommended due to performance reasons).
Now run the command below, substituting in the lcfs device you have chosen. In this example the device is /dev/sdb
:
# curl -fsSL http://lcfs.portworx.com/lcfs-setup.sh | sudo DEV=/dev/sdb bash
The convenience script will start dockerd with -s portworx/lcfs --experimental
and will also setup/enable a service management script. The service management script will start up LCFS automatically on system reboot. Service management commands allow lcfs to be stopped
, started
and view status
.
e.g. Systemd service to view LCFS status
# sudo systemctl status lcfs
LCFS removal can be done quickly using the installed setup script with the --remove
option.
# sudo /opt/lcfs/bin/lcfs-setup.sh --remove
Instead of the curl script above, LCFS can also be manually installed. To install LCFS manually, there are four actions you must perform:
- Install LCFS onto your system at
/var/lib/docker
and/lcfs
. - Start Docker using VFS as a graph driver. This is needed to install the LCFS plugin as a graph driver in Docker's configuration files at
/var/lib/docker
. - Build and install the LCFS plugin.
- Now you can restart Docker to use the LCFS plugin.
These four steps are detailed below.
- Build and install LCFS file system following the instructions in that directory.
- Stop docker - for example,
sudo systemctl stop docker
- Chose a device to provide to lcfs. lcfs requires a block device (you can also use a file, but this is not recommended due to performance reasons). In this example, we use
/dev/sdb
. - Start lcfs
# sudo mkdir -p /lcfs /var/lib/docker
# sudo lcfs daemon /dev/sdb /var/lib/docker /lcfs
Restart the Docker daemon and instruct it to use vfs as the graph driver. We will restart docker to use lcfs after in step #4.
# sudo dockerd -s vfs
We have built and pushed the LCFS plugin to Docker Hub for your use. You can install it by running the following command.
# sudo docker plugin install --grant-all-permissions portworx/lcfs
If you want to build the LCFS plugin manually you can run the following script
Make sure plugin is installed and enabled.
# sudo docker plugin ls
Note that at the time of writing this doc, Docker was required to be started in experimental mode.
Restart Docker to use LCFS. First stop dockerd. Then run Docker as:
# sudo dockerd -s portworx/lcfs --experimental
If you are running in systemd, you will need to edit your unit file, for example /lib/systemd/system/docker.service
.
Verify docker is running with portworx/lcfs storage driver by checking the output of command 'docker info'.
If for any reason you need to reset the LCFS file system, stop docker and do this (assuming your LCFS device is /dev/sdb):
# sudo umount -f /var/lib/docker /lcfs 2>/dev/null
# sudo dd if=/dev/zero of=/dev/sdb count=1 bs=4k
You can now restart LCFS and docker as per the previous steps.
To uninstall the LCFS plugin, run the following commands after stopping docker:
# sudo umount -f /var/lib/docker /lcfs 2>/dev/null
# rm -fr /run/docker/plugins/lcfs.sock
At this point, Docker can be restarted with the original storage driver. Note that your original image data from the previous driver will be intact.