Skip to content

Workflow for upgrading containers #58

Description

@jayofdoom

This is less a direct "issue" and more a question about how you guys do things, and if the cookbook facilitates something in a way I don't expect right now.

Lets say I have a container running some software. I build the container using something like this in my chef repo:

git '/data/software' do
  repository "https://github.com/org/software"
  revision "master"
end

docker_image "software-image" do
  path "/data/software"
  cmd_timeout 60000
  action :build
end

docker_container "software-container" do
  container_name "software-container"
  image "software-image"
  init_type "upstart"
  volume ["/data/persistentdata:/data/persistentdata"]
  command "--datadir /data/persistentdata"
  detach true
end

What would be the steps you'd follow to update the container when the git repository updates? Should I have to write out all the orchestration in chef? Create a versioned image and container? Something like this, perhaps?

docker_image "software-#{version}" do
  path "/data/software"
  action :build
end

docker_container "software-container-#{oldversion}" do
  [snip]
  action :remove
end

docker_container "software-container-#{version}" do
  [snip]
  action :create
end

All the options I've found seem tedious or difficult, and I'm curious how you're solving that problem.

Thanks,
Jay

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions