Comments (8)
There is actually :from_image
docker option. Unfortunately it doesn't allow to preserve initial image repository name and tag. It is also skips convergence phase.
from chef-provisioning-docker.
@marc- you should be able to do this:
require "chef/provisioning/docker_driver"
with_driver "docker"
machine_image "machine1" do
recipe "my_recipe::1"
machine_options :docker_options => {
:base_image => {
:name => "ubuntu",
:repository => "ubuntu",
:tag => "14.04"
}
}
end
machine_image "machine2" do
recipe "my_recipe::2"
from_image 'machine1'
end
from chef-provisioning-docker.
This will work for this particular case. But what if you need to run machine from local image, which wasn't created with machine_image
and is not available in remote registry, for instance built from Dockerfile?
from chef-provisioning-docker.
Modifying my example to make it more clear:
require "chef/provisioning/docker_driver"
with_driver "docker"
machine_image "machine" do
recipe "my_cookbook::some_recipe"
machine_options :docker_options => {
:base_image => {
:name => "image_built_from_dockerfile",
:repository => "image_built_from_dockerfile",
:tag => "latest"
}
}
end
from chef-provisioning-docker.
I'm just getting up to speed with all this, so I may be wrong. But my initial analysis is that we should support base images from an existing docker image in a remote repository, or a local repository (from a Dockerfile) or another machine_image
resource. I think its confusing to have two different ways to specify a base image - 1) via the from_image
attribute or 2) from the :base_image
hash in the :docker_options
.
Because from_image
is a base machine_options
attribute can we update it to support all the desired behaviors? We could have it accept a string like name:repository:tag
(because it only accepts a String now and not a Hash). First, we try to find a resource named name:repository:tag
. If we cannot find that, look for an image using the :name
, :repository
and :tag
parsed out from the String.
If we want to keep them separate, I think we should get much better documentation about the difference between the from_image
attribute (can only reference other resources) and the :base_image
hash in the machine_options
attribute (references either a local or remote Docker repo).
\cc @jkeiser
from chef-provisioning-docker.
Not sure if it's good idea to put docker specific options into chef-provisioning specific context.
Also, talking about refactoring and confusion, as there any justification for :name
base image option?
from chef-provisioning-docker.
The original issue should be fixed by PR #47. @tyler-ball go ahead and close, or leave open for discussion, as desired.
from chef-provisioning-docker.
Reading more carefully I see that Tyler asked me to close it, so.
from chef-provisioning-docker.
Related Issues (20)
- machine_image from_image
- Docker read_timeout apparently not working
- Unable to run docker image after provisioning
- Docker Provisioning with Chef-Server and Chef dk
- Setting hostname for a container does not work.
- Chef Zero binds to incorrect address
- No gem release since last updates HOT 3
- Is it possible not to have chef run every time the container starts up?
- Need volume support for machine_image HOT 1
- provisioning docker with chef-provisioning fails with "no such id" HOT 2
- docker-machine support HOT 1
- chef server URL being set to "172.17.0.1" and fails SSL verify HOT 6
- Update /etc/hosts of Docker container HOT 25
- volumes are not mounting properly HOT 3
- passing volumes gives docker server error HOT 1
- Connection refused connecting to http://172.17.0.1:8890/ HOT 3
- Proxy thread unable to start: Address already in use HOT 1
- Uploading file (using Docker API) to Chef provisioned container doesn't work HOT 4
- machine_image doesn't respect command HOT 2
- Request for Statement of Direction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chef-provisioning-docker.