indocker 0.0.6 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +10 -2
- data/.rspec +2 -0
- data/.travis.yml +7 -0
- data/Gemfile +5 -2
- data/Gemfile.lock +19 -49
- data/LICENSE.txt +17 -18
- data/README.md +20 -1
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/example/indocker/bin/deploy +120 -0
- data/example/indocker/bin/remote/compile +72 -0
- data/example/indocker/bin/remote/run +66 -0
- data/example/indocker/bin/utils/configurations.rb +3 -0
- data/example/indocker/bounded_contexts/shared/ruby/Dockerfile +10 -0
- data/example/indocker/bounded_contexts/shared/ruby/container.rb +5 -0
- data/example/indocker/bounded_contexts/shared/ruby/image.rb +3 -0
- data/example/indocker/configurations/dev.rb +9 -0
- data/example/indocker/infrastructure/build_servers.rb +8 -0
- data/example/indocker/infrastructure/networks.rb +1 -0
- data/example/indocker/infrastructure/registries.rb +3 -0
- data/example/indocker/infrastructure/servers.rb +8 -0
- data/example/indocker/setup.rb +24 -0
- data/indocker.gemspec +27 -25
- data/lib/indocker.rb +437 -130
- data/lib/indocker/artifacts/git.rb +25 -0
- data/lib/indocker/build_context.rb +87 -0
- data/lib/indocker/build_context_helper.rb +109 -0
- data/lib/indocker/build_context_pool.rb +36 -0
- data/lib/indocker/build_server.rb +2 -0
- data/lib/indocker/colored_string.rb +33 -0
- data/lib/indocker/concerns/inspectable.rb +12 -0
- data/lib/indocker/configuration_deployer.rb +525 -0
- data/lib/indocker/configurations/configuration.rb +122 -0
- data/lib/indocker/configurations/configuration_builder.rb +250 -0
- data/lib/indocker/configurations/formatters/stdout.rb +36 -0
- data/lib/indocker/container_deployer.rb +73 -0
- data/lib/indocker/container_helper.rb +13 -0
- data/lib/indocker/container_runner.rb +23 -0
- data/lib/indocker/containers/container.rb +118 -0
- data/lib/indocker/containers/container_builder.rb +186 -0
- data/lib/indocker/containers/restart_policy.rb +36 -0
- data/lib/indocker/context_args.rb +43 -0
- data/lib/indocker/crontab_redeploy_rules_builder.rb +54 -0
- data/lib/indocker/deploy_context.rb +126 -0
- data/lib/indocker/deployment_checker.rb +121 -0
- data/lib/indocker/deployment_progress.rb +495 -0
- data/lib/indocker/docker.rb +87 -0
- data/lib/indocker/docker_run_args.rb +183 -0
- data/lib/indocker/env_file_helper.rb +13 -0
- data/lib/indocker/env_files/local.rb +8 -0
- data/lib/indocker/env_files/remote.rb +8 -0
- data/lib/indocker/hash_merger.rb +9 -0
- data/lib/indocker/images/image.rb +86 -0
- data/lib/indocker/images/image_builder.rb +98 -0
- data/lib/indocker/images/image_compiler.rb +68 -0
- data/lib/indocker/images/template_compiler.rb +15 -0
- data/lib/indocker/images/templates_compiler.rb +28 -0
- data/lib/indocker/images_compiler.rb +38 -0
- data/lib/indocker/indocker_helper.rb +9 -0
- data/lib/indocker/network.rb +12 -0
- data/lib/indocker/network_helper.rb +7 -0
- data/lib/indocker/registries/abstract.rb +17 -0
- data/lib/indocker/registries/local.rb +5 -0
- data/lib/indocker/registries/remote.rb +12 -0
- data/lib/indocker/repositories/abstract.rb +25 -0
- data/lib/indocker/repositories/clonner.rb +17 -0
- data/lib/indocker/repositories/git.rb +24 -0
- data/lib/indocker/repositories/local.rb +20 -0
- data/lib/indocker/repositories/no_sync.rb +20 -0
- data/lib/indocker/rsync.rb +52 -0
- data/lib/indocker/server.rb +20 -0
- data/lib/indocker/server_pool.rb +30 -0
- data/lib/indocker/shell.rb +60 -0
- data/lib/indocker/ssh_result_logger.rb +18 -0
- data/lib/indocker/ssh_session.rb +92 -0
- data/lib/indocker/version.rb +1 -1
- data/lib/indocker/volume_helper.rb +7 -0
- data/lib/indocker/volumes/external.rb +8 -0
- data/lib/indocker/volumes/local.rb +9 -0
- data/lib/indocker/volumes/repository.rb +9 -0
- metadata +107 -222
- data/bin/indocker +0 -9
- data/lib/indocker/application_initializer.rb +0 -19
- data/lib/indocker/cli.rb +0 -27
- data/lib/indocker/configs/config.rb +0 -147
- data/lib/indocker/configs/config_factory.rb +0 -37
- data/lib/indocker/configs/config_initializer.rb +0 -9
- data/lib/indocker/configs/locator.rb +0 -23
- data/lib/indocker/container/container_builder.rb +0 -29
- data/lib/indocker/container/container_directives_runner.rb +0 -54
- data/lib/indocker/container/container_dsl.rb +0 -83
- data/lib/indocker/container/container_evaluator.rb +0 -13
- data/lib/indocker/container/container_inspector.rb +0 -26
- data/lib/indocker/container/container_manager.rb +0 -122
- data/lib/indocker/container/container_metadata.rb +0 -112
- data/lib/indocker/container/container_metadata_factory.rb +0 -30
- data/lib/indocker/container/container_metadata_repository.rb +0 -27
- data/lib/indocker/directives/base.rb +0 -17
- data/lib/indocker/directives/container_directives/base.rb +0 -23
- data/lib/indocker/directives/container_directives/cmd.rb +0 -7
- data/lib/indocker/directives/container_directives/depends_on.rb +0 -7
- data/lib/indocker/directives/container_directives/env.rb +0 -7
- data/lib/indocker/directives/container_directives/env_file.rb +0 -7
- data/lib/indocker/directives/container_directives/expose.rb +0 -7
- data/lib/indocker/directives/container_directives/from.rb +0 -14
- data/lib/indocker/directives/container_directives/network.rb +0 -12
- data/lib/indocker/directives/container_directives/ports.rb +0 -15
- data/lib/indocker/directives/container_directives/ready.rb +0 -16
- data/lib/indocker/directives/container_directives/volume.rb +0 -23
- data/lib/indocker/directives/image_directives/base.rb +0 -27
- data/lib/indocker/directives/image_directives/cmd.rb +0 -19
- data/lib/indocker/directives/image_directives/copy.rb +0 -32
- data/lib/indocker/directives/image_directives/docker_cp.rb +0 -20
- data/lib/indocker/directives/image_directives/entrypoint.rb +0 -19
- data/lib/indocker/directives/image_directives/env.rb +0 -9
- data/lib/indocker/directives/image_directives/env_file.rb +0 -19
- data/lib/indocker/directives/image_directives/expose.rb +0 -9
- data/lib/indocker/directives/image_directives/from.rb +0 -36
- data/lib/indocker/directives/image_directives/registry.rb +0 -30
- data/lib/indocker/directives/image_directives/run.rb +0 -17
- data/lib/indocker/directives/image_directives/workdir.rb +0 -9
- data/lib/indocker/directives/partial.rb +0 -21
- data/lib/indocker/docker_api/container_config.rb +0 -121
- data/lib/indocker/docker_api/docker_api.rb +0 -207
- data/lib/indocker/dsl_context.rb +0 -21
- data/lib/indocker/envs/env_metadata.rb +0 -39
- data/lib/indocker/envs/loader.rb +0 -19
- data/lib/indocker/errors.rb +0 -21
- data/lib/indocker/git/git_api.rb +0 -32
- data/lib/indocker/git/git_helper.rb +0 -34
- data/lib/indocker/git/git_service.rb +0 -21
- data/lib/indocker/handlers/container_run.rb +0 -20
- data/lib/indocker/handlers/container_stop.rb +0 -17
- data/lib/indocker/handlers/performable.rb +0 -22
- data/lib/indocker/image/image_builder.rb +0 -54
- data/lib/indocker/image/image_dependencies_manager.rb +0 -47
- data/lib/indocker/image/image_directives_runner.rb +0 -99
- data/lib/indocker/image/image_dockerfile_builder.rb +0 -24
- data/lib/indocker/image/image_dsl.rb +0 -89
- data/lib/indocker/image/image_evaluator.rb +0 -21
- data/lib/indocker/image/image_helper.rb +0 -9
- data/lib/indocker/image/image_metadata.rb +0 -50
- data/lib/indocker/image/image_metadata_factory.rb +0 -31
- data/lib/indocker/image/image_metadata_repository.rb +0 -29
- data/lib/indocker/networks/network_metadata.rb +0 -9
- data/lib/indocker/networks/network_metadata_factory.rb +0 -9
- data/lib/indocker/networks/network_metadata_repository.rb +0 -34
- data/lib/indocker/partial/partial_metadata.rb +0 -8
- data/lib/indocker/partial/partial_metadata_repository.rb +0 -26
- data/lib/indocker/registry/registry_api.rb +0 -46
- data/lib/indocker/registry/registry_helper.rb +0 -20
- data/lib/indocker/registry/registry_service.rb +0 -28
- data/lib/indocker/utils/ioc_container.rb +0 -17
- data/lib/indocker/utils/logger.rb +0 -62
- data/lib/indocker/utils/logger_factory.rb +0 -13
- data/lib/indocker/utils/registry_authenticator.rb +0 -19
- data/lib/indocker/utils/render_namespace.rb +0 -11
- data/lib/indocker/utils/render_util.rb +0 -15
- data/lib/indocker/utils/string_utils.rb +0 -11
- data/lib/indocker/utils/tar_helper.rb +0 -40
- data/lib/indocker/utils/test_logger_factory.rb +0 -9
- data/lib/indocker/volumes/volume_metadata.rb +0 -9
- data/lib/indocker/volumes/volume_metadata_factory.rb +0 -9
- data/lib/indocker/volumes/volume_metadata_repository.rb +0 -34
- data/spec/example/.indocker/config.rb +0 -30
- data/spec/example/.indocker/images_and_containers.rb +0 -25
- data/spec/example/assets/index.css +0 -1
- data/spec/example/assets/index.js +0 -1
- data/spec/fixtures/spec.env +0 -2
- data/spec/indocker/configs/config_factory_spec.rb +0 -18
- data/spec/indocker/configs/config_spec.rb +0 -88
- data/spec/indocker/container/container_builder_spec.rb +0 -67
- data/spec/indocker/container/container_manager_spec.rb +0 -278
- data/spec/indocker/docker_api/container_config_spec.rb +0 -64
- data/spec/indocker/docker_api/docker_api_spec.rb +0 -112
- data/spec/indocker/handlers/container_run_spec.rb +0 -60
- data/spec/indocker/image/image_builder_spec.rb +0 -153
- data/spec/indocker/image/image_directives_runner_spec.rb +0 -141
- data/spec/indocker/image/image_dockerfile_builder_spec.rb +0 -25
- data/spec/indocker/image/image_evaluator_spec.rb +0 -85
- data/spec/spec_helper.rb +0 -68
@@ -1,13 +0,0 @@
|
|
1
|
-
class Indocker::ContainerEvaluator
|
2
|
-
include SmartIoC::Iocify
|
3
|
-
|
4
|
-
bean :container_evaluator
|
5
|
-
|
6
|
-
def evaluate(context, &block)
|
7
|
-
container_dsl = Indocker::ContainerDSL.new(context)
|
8
|
-
|
9
|
-
container_dsl.instance_exec(&block)
|
10
|
-
|
11
|
-
container_dsl.directives
|
12
|
-
end
|
13
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
class Indocker::ContainerInspector
|
2
|
-
include SmartIoC::Iocify
|
3
|
-
|
4
|
-
bean :container_inspector
|
5
|
-
|
6
|
-
inject :container_builder
|
7
|
-
|
8
|
-
def changed?(name)
|
9
|
-
container_config = docker_api.inspect_container(name)[Config]
|
10
|
-
host_config = docker_api.inspect_container(name)[HostConfig]
|
11
|
-
|
12
|
-
inspected_config = Indocker::ContainerConfig.new(
|
13
|
-
image: container_config['Image'],
|
14
|
-
cmd: container_config['Cmd'],
|
15
|
-
env: container_config['Env'],
|
16
|
-
volumes: container_config['Volumes'],
|
17
|
-
binds: host_config['Binds'],
|
18
|
-
exposed_ports: container_config['ExposedPorts'],
|
19
|
-
port_bindings: host_config['PortBindings']
|
20
|
-
)
|
21
|
-
|
22
|
-
metadata_config = container_builder.build(name)
|
23
|
-
|
24
|
-
inspected_config == metadata_config
|
25
|
-
end
|
26
|
-
end
|
@@ -1,122 +0,0 @@
|
|
1
|
-
class Indocker::ContainerManager
|
2
|
-
KEEP_CONTAINER_RUNNING_COMMAND = %w(tail -F -n0 /etc/hosts)
|
3
|
-
|
4
|
-
include SmartIoC::Iocify
|
5
|
-
|
6
|
-
bean :container_manager
|
7
|
-
|
8
|
-
inject :container_metadata_repository
|
9
|
-
inject :image_metadata_repository
|
10
|
-
inject :container_directives_runner
|
11
|
-
inject :docker_api
|
12
|
-
inject :logger
|
13
|
-
inject :tar_helper
|
14
|
-
inject :config
|
15
|
-
inject :container_builder
|
16
|
-
|
17
|
-
def create(name)
|
18
|
-
container_config = container_builder.build(name)
|
19
|
-
|
20
|
-
container_id = docker_api.create_container(container_config)
|
21
|
-
|
22
|
-
logger.info "Successfully created container :#{name}"
|
23
|
-
|
24
|
-
container_id
|
25
|
-
end
|
26
|
-
|
27
|
-
def run(name)
|
28
|
-
container_metadata = container_metadata_repository.get_by_name(name)
|
29
|
-
|
30
|
-
container_image_id = docker_api.get_container_image_id(name)
|
31
|
-
image_id = docker_api.get_image_id(container_metadata.repo, tag: container_metadata.tag)
|
32
|
-
|
33
|
-
raise Indocker::Errors::ImageIsNotBuilded, container_metadata.image if image_id.nil?
|
34
|
-
|
35
|
-
if docker_api.container_exists?(name)
|
36
|
-
if image_id != container_image_id
|
37
|
-
stop(name)
|
38
|
-
delete(name)
|
39
|
-
create(name)
|
40
|
-
end
|
41
|
-
else
|
42
|
-
create(name)
|
43
|
-
end
|
44
|
-
|
45
|
-
stop(name)
|
46
|
-
start(name, attach: container_metadata.attach)
|
47
|
-
end
|
48
|
-
|
49
|
-
def start(name, attach: false)
|
50
|
-
container_metadata = container_metadata_repository.get_by_name(name)
|
51
|
-
|
52
|
-
container_directives_runner.run_all(
|
53
|
-
container_metadata.before_start_directives
|
54
|
-
)
|
55
|
-
|
56
|
-
container_metadata.container_dependencies.each do |dependency|
|
57
|
-
dependency_metadata = container_metadata_repository.get_by_name(dependency)
|
58
|
-
create(dependency) unless docker_api.container_exists?(dependency)
|
59
|
-
|
60
|
-
if docker_api.get_container_state(dependency) == Indocker::ContainerMetadata::States::RUNNING
|
61
|
-
logger.info "Dependency container :#{dependency} already running"
|
62
|
-
else
|
63
|
-
start(dependency, attach: dependency_metadata.attach)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
container_id = docker_api.start_container(name, attach: attach)
|
68
|
-
|
69
|
-
logger.info "Successfully started container :#{name}"
|
70
|
-
|
71
|
-
container_directives_runner.run_all(
|
72
|
-
container_metadata.after_start_directives
|
73
|
-
)
|
74
|
-
|
75
|
-
container_id
|
76
|
-
end
|
77
|
-
|
78
|
-
def stop(name)
|
79
|
-
container_id = docker_api.stop_container(name)
|
80
|
-
|
81
|
-
logger.info "Successfully stopped container :#{name}"
|
82
|
-
|
83
|
-
container_id
|
84
|
-
end
|
85
|
-
|
86
|
-
def delete(name)
|
87
|
-
stop(name)
|
88
|
-
|
89
|
-
container_id = docker_api.delete_container(name)
|
90
|
-
|
91
|
-
logger.info "Successfully deleted container :#{name}"
|
92
|
-
|
93
|
-
container_id
|
94
|
-
end
|
95
|
-
|
96
|
-
def copy(name:, copy_from:, copy_to:)
|
97
|
-
container_metadata = container_metadata_repository.get_by_name(name)
|
98
|
-
|
99
|
-
container_id = docker_api.get_container_id(name) ||
|
100
|
-
docker_api.create_container(container_builder.build(name))
|
101
|
-
|
102
|
-
tar_snapshot = config.build_dir.join('snapshots', "#{name.to_s}.tar")
|
103
|
-
|
104
|
-
FileUtils.mkdir_p(File.dirname(tar_snapshot))
|
105
|
-
docker_api.copy_from_container(name: container_id, path: copy_from) do |tar_archive|
|
106
|
-
File.open(tar_snapshot, 'a+') {|f| f.write(tar_archive)}
|
107
|
-
end
|
108
|
-
|
109
|
-
files_list = tar_helper.untar(
|
110
|
-
io: File.open(tar_snapshot, 'r'),
|
111
|
-
destination: copy_to,
|
112
|
-
ignore_wrap_directory: File.basename(copy_from) == '.'
|
113
|
-
)
|
114
|
-
|
115
|
-
FileUtils.rm_rf(tar_snapshot)
|
116
|
-
|
117
|
-
docker_api.stop_container(container_id)
|
118
|
-
docker_api.delete_container(container_id)
|
119
|
-
|
120
|
-
files_list
|
121
|
-
end
|
122
|
-
end
|
@@ -1,112 +0,0 @@
|
|
1
|
-
class Indocker::ContainerMetadata
|
2
|
-
attr_reader :name, :attach
|
3
|
-
|
4
|
-
module States
|
5
|
-
CREATED = 'created'
|
6
|
-
RESTARTING = 'restarting'
|
7
|
-
RUNNING = 'running'
|
8
|
-
PAUSED = 'paused'
|
9
|
-
EXITED = 'exited'
|
10
|
-
DEAD = 'dead'
|
11
|
-
|
12
|
-
ALL = [CREATED, RESTARTING, RUNNING, PAUSED, EXITED, DEAD]
|
13
|
-
end
|
14
|
-
|
15
|
-
def initialize(name:, directives:, attach: false)
|
16
|
-
@name = name
|
17
|
-
@directives = directives
|
18
|
-
@attach = attach
|
19
|
-
end
|
20
|
-
|
21
|
-
def repo
|
22
|
-
from_directive.repo
|
23
|
-
end
|
24
|
-
|
25
|
-
def tag
|
26
|
-
from_directive.tag
|
27
|
-
end
|
28
|
-
|
29
|
-
def image
|
30
|
-
from_directive.image
|
31
|
-
end
|
32
|
-
|
33
|
-
def networks
|
34
|
-
network_directives.map(&:name)
|
35
|
-
end
|
36
|
-
|
37
|
-
def volumes
|
38
|
-
volume_directives.map(&:docker_name)
|
39
|
-
end
|
40
|
-
|
41
|
-
def binds
|
42
|
-
volume_directives.map(&:to_hash)
|
43
|
-
end
|
44
|
-
|
45
|
-
def envs
|
46
|
-
envs_directives.inject([]) { |all, dir| all.concat dir.env_string }
|
47
|
-
end
|
48
|
-
|
49
|
-
def env_files
|
50
|
-
env_files_directives.map(&:path)
|
51
|
-
end
|
52
|
-
|
53
|
-
def exposed_ports
|
54
|
-
expose_directives.map(&:port) + ports_directives.map(&:container_port)
|
55
|
-
end
|
56
|
-
|
57
|
-
def port_bindings
|
58
|
-
ports_directives.map(&:to_hash)
|
59
|
-
end
|
60
|
-
|
61
|
-
def command
|
62
|
-
directive = @directives.detect {|c| c.instance_of?(Indocker::ContainerDirectives::Cmd)}
|
63
|
-
|
64
|
-
directive ? directive.cmd : nil
|
65
|
-
end
|
66
|
-
|
67
|
-
def container_dependencies
|
68
|
-
depends_on_directives.map(&:container_name)
|
69
|
-
end
|
70
|
-
|
71
|
-
def before_start_directives
|
72
|
-
@directives.select(&:before_start?)
|
73
|
-
end
|
74
|
-
|
75
|
-
def after_start_directives
|
76
|
-
@directives.select(&:after_start?)
|
77
|
-
end
|
78
|
-
|
79
|
-
private
|
80
|
-
|
81
|
-
def from_directive
|
82
|
-
@directives.detect {|c| c.instance_of?(Indocker::ContainerDirectives::From)}
|
83
|
-
end
|
84
|
-
|
85
|
-
def network_directives
|
86
|
-
@directives.select {|d| d.instance_of?(Indocker::ContainerDirectives::Network)}
|
87
|
-
end
|
88
|
-
|
89
|
-
def env_files_directives
|
90
|
-
@directives.select {|d| d.instance_of?(Indocker::ContainerDirectives::EnvFile)}
|
91
|
-
end
|
92
|
-
|
93
|
-
def envs_directives
|
94
|
-
@directives.select {|d| d.instance_of?(Indocker::ContainerDirectives::Env)}
|
95
|
-
end
|
96
|
-
|
97
|
-
def expose_directives
|
98
|
-
@directives.select {|d| d.instance_of?(Indocker::ContainerDirectives::Expose)}
|
99
|
-
end
|
100
|
-
|
101
|
-
def ports_directives
|
102
|
-
@directives.select {|d| d.instance_of?(Indocker::ContainerDirectives::Ports)}
|
103
|
-
end
|
104
|
-
|
105
|
-
def depends_on_directives
|
106
|
-
@directives.select {|d| d.instance_of?(Indocker::ContainerDirectives::DependsOn)}
|
107
|
-
end
|
108
|
-
|
109
|
-
def volume_directives
|
110
|
-
@directives.select {|d| d.instance_of?(Indocker::ContainerDirectives::Volume)}
|
111
|
-
end
|
112
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
class Indocker::ContainerMetadataFactory
|
2
|
-
include SmartIoC::Iocify
|
3
|
-
|
4
|
-
bean :container_metadata_factory
|
5
|
-
|
6
|
-
inject :docker_api
|
7
|
-
inject :container_evaluator
|
8
|
-
inject :image_metadata_repository
|
9
|
-
inject :network_metadata_repository
|
10
|
-
inject :container_metadata_repository
|
11
|
-
inject :volume_metadata_repository
|
12
|
-
|
13
|
-
def create(name, attach: false, &definition)
|
14
|
-
context = Indocker::DSLContext.new(
|
15
|
-
images: image_metadata_repository,
|
16
|
-
networks: network_metadata_repository,
|
17
|
-
containers: container_metadata_repository,
|
18
|
-
volumes: volume_metadata_repository,
|
19
|
-
container_name: name
|
20
|
-
)
|
21
|
-
|
22
|
-
directives = container_evaluator.evaluate(context, &definition)
|
23
|
-
|
24
|
-
Indocker::ContainerMetadata.new(
|
25
|
-
name: name.to_s,
|
26
|
-
directives: directives,
|
27
|
-
attach: attach
|
28
|
-
)
|
29
|
-
end
|
30
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
class Indocker::ContainerMetadataRepository
|
2
|
-
include SmartIoC::Iocify
|
3
|
-
|
4
|
-
bean :container_metadata_repository
|
5
|
-
|
6
|
-
def put(metadata)
|
7
|
-
if get_by_name(metadata.name)
|
8
|
-
raise Indocker::Errors::InvalidParams, "Container name '#{metadata.name}' already in use"
|
9
|
-
end
|
10
|
-
|
11
|
-
all.push(metadata)
|
12
|
-
end
|
13
|
-
|
14
|
-
def get_by_name(container_name)
|
15
|
-
container = all.detect {|container| container.name == container_name.to_s}
|
16
|
-
|
17
|
-
container
|
18
|
-
end
|
19
|
-
|
20
|
-
def clear
|
21
|
-
@all = []
|
22
|
-
end
|
23
|
-
|
24
|
-
def all
|
25
|
-
@all ||= []
|
26
|
-
end
|
27
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Indocker::ContainerDirectives
|
2
|
-
class Base < Indocker::Directives::Base
|
3
|
-
def container_directive?
|
4
|
-
true
|
5
|
-
end
|
6
|
-
|
7
|
-
def before_start?
|
8
|
-
false
|
9
|
-
end
|
10
|
-
|
11
|
-
def after_start?
|
12
|
-
false
|
13
|
-
end
|
14
|
-
|
15
|
-
def before_stop?
|
16
|
-
false
|
17
|
-
end
|
18
|
-
|
19
|
-
def after_stop?
|
20
|
-
false
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class Indocker::ContainerDirectives::From < Indocker::ContainerDirectives::Base
|
2
|
-
include Indocker::ImageHelper
|
3
|
-
|
4
|
-
attr_accessor :repo, :tag
|
5
|
-
|
6
|
-
def initialize(repo, tag: Indocker::ImageHelper::DEFAULT_TAG)
|
7
|
-
@repo = repo
|
8
|
-
@tag = tag
|
9
|
-
end
|
10
|
-
|
11
|
-
def image
|
12
|
-
full_name(@repo, @tag)
|
13
|
-
end
|
14
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class Indocker::ContainerDirectives::Network < Indocker::ContainerDirectives::Base
|
2
|
-
attr_accessor :network_name, :container_name
|
3
|
-
|
4
|
-
def initialize(network_name:, container_name:)
|
5
|
-
@network_name = network_name
|
6
|
-
@container_name = container_name
|
7
|
-
end
|
8
|
-
|
9
|
-
def before_start?
|
10
|
-
true
|
11
|
-
end
|
12
|
-
end
|