Skip to content

build_image: Add prodtar command to build a tar ball#51

Merged
pothos merged 2 commits intoflatcar-masterfrom
kai/build-prod-container-tar
Feb 7, 2020
Merged

build_image: Add prodtar command to build a tar ball#51
pothos merged 2 commits intoflatcar-masterfrom
kai/build-prod-container-tar

Conversation

@pothos
Copy link
Copy Markdown
Member

@pothos pothos commented Jan 29, 2020

Create a tar ball with the contents of the / and /usr partitions
to be used as follows with systemd-nspawn (via machinectl):
machinectl import-tar flatcar-container.tar.gz flatcar-container
machinectl start flatcar-container
machinectl shell flatcar-container
or with docker by converting it to an OCI image:
docker import -c "CMD /bin/bash" flatcar-container.tar.gz flatcar-container

Since the new "prodtar" command relies on the results of the "prod" command,
it bundles it so that "prod prodtar" and "prodtar" is the same.

Note: Document how to use the tars on the website. Automatically push docker images to a repository.

@pothos pothos requested a review from dongsupark January 29, 2020 12:04
@pothos pothos force-pushed the kai/build-prod-container-tar branch from 8fabb72 to 50c5bb1 Compare January 29, 2020 12:18
@dongsupark
Copy link
Copy Markdown
Member

I think in general it is ok to add "tarball" to the list of supported format.

However, if we start calling it "prodcontainer", then it gets hard to distinguish it from the existing "developer container". Both can be used for containers, but prod is a tarball, while dev is an image including partitions etc.? Users could get confused.

If we want to introduce a real generic format for containers, ideally we should create an OCI image, by using tools like buildah or umoci. Though in reality we cannot say either that the standard OCI images are widely used.

So I am not sure what the best way is.

@pothos pothos force-pushed the kai/build-prod-container-tar branch from 50c5bb1 to c040a1b Compare January 31, 2020 16:52
@pothos pothos changed the title build_image: Add prodcontainer command to build a tar ball build_image: Add prodtar command to build a tar ball Jan 31, 2020
@pothos pothos marked this pull request as ready for review January 31, 2020 16:52
@pothos
Copy link
Copy Markdown
Member Author

pothos commented Jan 31, 2020

Ok, I've renamed it.

@pothos pothos requested a review from t-lo February 7, 2020 15:26
Copy link
Copy Markdown
Member

@t-lo t-lo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit (documentation update), please consider including. Otherwise LGTM, approving.

build_image Outdated

prod - Production image for CoreOS. This image is for booting.
prod - Production image for CoreOS. This image is for booting (default if no argument is given).
prodtar - Production container tar ball (implies prod). Usable by machinectl import-tar or with docker import.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "This can e.g. be used to run the Flatcar production image in a container."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it, but changed it to as a container because the image is run as a container and not inside one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you 😄

Create a tar ball with the contents of the / and /usr partitions
to be used as follows with systemd-nspawn (via machinectl):
  machinectl import-tar flatcar-container.tar.gz flatcar-container
  machinectl start flatcar-container
  machinectl shell flatcar-container
or with docker by converting it to an OCI image:
  docker import -c "CMD /bin/bash" flatcar-container.tar.gz flatcar-container

Since the new "prodtar" command relies on the results of the "prod" command,
it bundles it so that "prod prodtar" and "prodtar" is the same.
@pothos pothos force-pushed the kai/build-prod-container-tar branch from c040a1b to 21edb36 Compare February 7, 2020 15:55
@pothos
Copy link
Copy Markdown
Member Author

pothos commented Feb 7, 2020

I have added a commit for Jenkins to produce this tar ball by default.

@pothos pothos requested a review from t-lo February 7, 2020 16:28
Copy link
Copy Markdown
Member

@t-lo t-lo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pothos pothos merged commit 2f99e2a into flatcar-master Feb 7, 2020
@pothos pothos deleted the kai/build-prod-container-tar branch February 7, 2020 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants