Skip to content

Some fixes for Docker library #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/berkeley_library/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module BerkeleyLibrary
module Docker
class << self
def running_in_container?
File.exist?('/.dockerenv') || init_cgroup_is_dockerish?
File.exist?('/.dockerenv') || init_cgroup_is_dockerish? || env_is_podmanish?
end

private
Expand All @@ -19,6 +19,10 @@ def init_cgroup_is_dockerish?
false
end
end

def env_is_podmanish?
ENV.fetch('container', '') == 'podman'
end
end
end
end
18 changes: 10 additions & 8 deletions lib/berkeley_library/docker/module_info.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# frozen_string_literal: true

module BerkeleyLibrary
module Docker
class ModuleInfo
NAME = 'berkeley_library-docker'.freeze
AUTHOR = 'Dan Schmidt'.freeze
AUTHOR_EMAIL = '[email protected]'.freeze
SUMMARY = 'Utility functions for Dockerizing Ruby apps'.freeze
DESCRIPTION = 'Utility functions for making Ruby apps "just work" in Docker containers.'.freeze
LICENSE = 'MIT'.freeze
VERSION = '0.2.0'.freeze
HOMEPAGE = 'https://github.com/BerkeleyLibrary/docker'.freeze
NAME = 'berkeley_library-docker'
AUTHOR = 'Dan Schmidt'
AUTHOR_EMAIL = '[email protected]'
SUMMARY = 'Utility functions for Dockerizing Ruby apps'
DESCRIPTION = 'Utility functions for making Ruby apps "just work" in Docker containers.'
LICENSE = 'MIT'
VERSION = '0.3.0.a1'
HOMEPAGE = 'https://github.com/BerkeleyLibrary/ruby-docker'

private_class_method :new
end
Expand Down