Class: Hookit::Platform::Docker

Inherits:
Base
  • Object
show all
Defined in:
lib/hookit/platform/docker.rb

Instance Method Summary collapse

Instance Method Details

#detect?Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
# File 'lib/hookit/platform/docker.rb', line 5

def detect?
  ! `if [ -f "/.dockerenv" ] || [ -f "/.dockerinit" ] || \
    grep -qF /docker/ "/proc/self/cgroup" 2>/dev/null; then
      echo docker
  fi`.empty?
end

#nameObject



12
13
14
# File 'lib/hookit/platform/docker.rb', line 12

def name
  'docker'
end

#osObject



16
17
18
# File 'lib/hookit/platform/docker.rb', line 16

def os
  'linux'
end