Skip to content
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

allow windows docker studio and exported images to run on kernels later than 2016ltsc #6643

Merged
merged 1 commit into from Jun 18, 2019

Conversation

@mwrock
Copy link
Contributor

commented Jun 11, 2019

Today when we build windows containers, we use microsoft/windowsservercore:2016ltsc as a base image. This works (both for building and consuming) on a 2016 Server host or any host using Hyper-V isolation which will run a container inside of a light weight VM. The bottom line is that a container can only be run in a host that supports the kernel version of the image. This PR allows us to build windows containers for all docker supported kernels.

Exporter changes

The docker exporter now takes an optional arg (only on windows) --base-image that a user can use to specify a specific base image for building. If none is provided, the exporter will use the appropriate base image based on the running host.

Plans for building non-2016 studios

As this code stands with our existing build infrastructure, we will continue to build 2016 studios since our build queues are all 2016 images. However this gives us the ability to use either different build images for building other versions or use a single bare metal hyper-v host to build a collection of different versions.

General Refactorings

There are a couple refactorings included here:

  • Finding the docker command and determining the base image tag based on host are extracted to the core crate since they are used by both hab and pkg-exporter-docker.
  • When the hab cli delegates to an exporter, it now uses command::pkg::exec::start so that the runtime deps of the exporter are added to the path which include docker for the docker exporter.

Signed-off-by: mwrock matt@mattwrock.com

@chef-expeditor

This comment has been minimized.

Copy link

commented Jun 11, 2019

Hello mwrock! Thanks for the pull request!

Here is what will happen next:

  1. Your PR will be reviewed by the maintainers.
  2. If everything looks good, one of them will approve it, and your PR will be merged.

Thank you for contributing!

@mwrock mwrock force-pushed the win_base_tag branch from ec0b2ab to d28f254 Jun 11, 2019

@mwrock mwrock marked this pull request as ready for review Jun 11, 2019

@mwrock mwrock force-pushed the win_base_tag branch from d28f254 to 88c34bf Jun 11, 2019

@mwrock

This comment has been minimized.

Copy link
Contributor Author

commented Jun 11, 2019

fixes #6412

@baumanj
Copy link
Member

left a comment

Per discussion, I'll review this starting Monday, June 17

@scotthain
Copy link
Contributor

left a comment

Powershell looks good, saw no obvious typos in the rust code but can't speak to the correctness of it.

@davidMcneil
Copy link
Contributor

left a comment

I am not an expert in the space, but this looks good to me. I saw two small things.

components/core/src/util/docker.rs Outdated Show resolved Hide resolved
components/pkg-export-docker/src/build.rs Outdated Show resolved Hide resolved

@mwrock mwrock force-pushed the win_base_tag branch from c093f09 to 3c3ff87 Jun 14, 2019

@baumanj
Copy link
Member

left a comment

No required changes, but I think we could make some simplifications and usability improvements. Take or leave any of these according to your judgement.

components/core/src/util/docker.rs Outdated Show resolved Hide resolved
components/core/src/util/docker.rs Outdated Show resolved Hide resolved
components/core/src/util/docker.rs Outdated Show resolved Hide resolved
components/core/src/util/docker.rs Outdated Show resolved Hide resolved
components/pkg-export-docker/src/build.rs Outdated Show resolved Hide resolved
components/pkg-export-docker/src/cli.rs Show resolved Hide resolved
allow windows docker studio and exported images to run on kernels lat…
…er than 2016ltsc

Signed-off-by: mwrock <matt@mattwrock.com>

@mwrock mwrock force-pushed the win_base_tag branch from bb94d6f to ac44986 Jun 18, 2019

@mwrock

This comment has been minimized.

Copy link
Contributor Author

commented Jun 18, 2019

thanks @baumanj for the review. Just pushed up changes addressing all of your comments.

@baumanj
Copy link
Member

left a comment

Thanks for incorporating all that feedback!

@mwrock mwrock merged commit ff90c9c into master Jun 18, 2019

5 checks passed

DCO This commit has a DCO Signed-off-by
Details
buildkite/habitat-sh-habitat-master-verify Build #2416 passed (23 minutes, 22 seconds)
Details
buildkite/habitat-sh-habitat-master-website Build #2840 passed (33 seconds)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
expeditor/config-validation Validated your Expeditor config file
Details

@mwrock mwrock deleted the win_base_tag branch Jun 18, 2019

chef-ci added a commit that referenced this pull request Jun 18, 2019

Update CHANGELOG.md with details from pull request #6643
Obvious fix; these changes are the result of automation not creative thinking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.