diff --git a/DockerStandaloneHost/package/Classes/DockerStandaloneHost.yaml b/DockerStandaloneHost/package/Classes/DockerStandaloneHost.yaml index 9ec11f0..46454de 100644 --- a/DockerStandaloneHost/package/Classes/DockerStandaloneHost.yaml +++ b/DockerStandaloneHost/package/Classes/DockerStandaloneHost.yaml @@ -62,10 +62,12 @@ Methods: Then: - $._environment.reporter.report($this, 'Create VM for Docker Server') - $.instance.deploy() + - $resources: new(sys:Resources) + - $template: $resources.yaml('StartDocker.template') + - $.instance.agent.call($template, $resources) - If: $.dockerRegistry != null and $.dockerRegistry != '' Then: - $._environment.reporter.report($this, 'Configuring Docker registry') - - $resources: new(sys:Resources) - $template: $resources.yaml('SetupDockerRegistry.template').bind(dict( dockerRegistry => $.dockerRegistry )) diff --git a/DockerStandaloneHost/package/Resources/StartDocker.template b/DockerStandaloneHost/package/Resources/StartDocker.template new file mode 100644 index 0000000..4f7ea32 --- /dev/null +++ b/DockerStandaloneHost/package/Resources/StartDocker.template @@ -0,0 +1,31 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +FormatVersion: 2.0.0 +Version: 1.0.0 +Name: Start docker service + +Parameters: + image: $image + +Body: | + startDocker() + +Scripts: + startDocker: + Type: Application + Version: 1.0.0 + EntryPoint: startDocker.sh + Options: + captureStdout: false + captureStderr: false + verifyExitcode: false diff --git a/DockerStandaloneHost/package/Resources/scripts/startDocker.sh b/DockerStandaloneHost/package/Resources/scripts/startDocker.sh new file mode 100644 index 0000000..e64e325 --- /dev/null +++ b/DockerStandaloneHost/package/Resources/scripts/startDocker.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +service docker start \ No newline at end of file