Class: Mrsk::Commands::Docker
Constant Summary
Constants inherited from Base
Base::DOCKER_HEALTH_LOG_FORMAT, Base::DOCKER_HEALTH_STATUS_FORMAT
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#install ⇒ Object
Install Docker using the github.com/docker/docker-install convenience script.
-
#installed? ⇒ Boolean
Checks the Docker client version.
-
#running? ⇒ Boolean
Checks the Docker server version.
-
#superuser? ⇒ Boolean
Do we have superuser access to install Docker and start system services?.
Methods inherited from Base
#container_id_for, #initialize, #run_over_ssh
Constructor Details
This class inherits a constructor from Mrsk::Commands::Base
Instance Method Details
#install ⇒ Object
Install Docker using the github.com/docker/docker-install convenience script.
3 4 5 |
# File 'lib/mrsk/commands/docker.rb', line 3 def install pipe [ :curl, "-fsSL", "https://get.docker.com" ], :sh end |
#installed? ⇒ Boolean
Checks the Docker client version. Fails if Docker is not installed.
8 9 10 |
# File 'lib/mrsk/commands/docker.rb', line 8 def installed? docker "-v" end |
#running? ⇒ Boolean
Checks the Docker server version. Fails if Docker is not running.
13 14 15 |
# File 'lib/mrsk/commands/docker.rb', line 13 def running? docker :version end |
#superuser? ⇒ Boolean
Do we have superuser access to install Docker and start system services?
18 19 20 |
# File 'lib/mrsk/commands/docker.rb', line 18 def superuser? [ '[ "${EUID:-$(id -u)}" -eq 0 ]' ] end |