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

CRI: Add Buildah to ISO, for building OCI images #3225

Closed
wants to merge 3 commits into from

Conversation

afbjorklund
Copy link
Collaborator

@afbjorklund afbjorklund commented Oct 5, 2018

After adding podman (#2757), also add buildah.

https://www.projectatomic.io/blog/2017/06/introducing-buildah/

This makes it possible to also build images...

Here is the buildah tutorial in minikube, slightly modified: (fedora -> alpine, java -> python)

                         _             _            
            _         _ ( )           ( )           
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __  
/' _ ` _ `\| |/' _ `\| || , <  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

$ sudo -i
# buildah images
# buildah containers
CONTAINER ID  BUILDER  IMAGE ID     IMAGE NAME                       CONTAINER NAME
# container=$(buildah from alpine)
Getting image source signatures
Copying blob sha256:4fe2ade4980c2dda4fc95858ebb981489baec8c1e4bd282ab1c3560be8ff9bde
 2.10 MiB / 2.10 MiB [======================================================] 0s
Copying config sha256:196d12cf6ab19273823e700516e98eb1910b03b17840f9d5509f03858484d321
 1.48 KiB / 1.48 KiB [======================================================] 0s
Writing manifest to image destination
Storing signatures
# echo $container
alpine-working-container
# buildah run $container ash
container_linux.go:296: starting container process caused "process_linux.go:398: container init caused \"rootfs_linux.go:107: jailing process inside rootfs caused \\\"pivot_root invalid argument\\\"\""
error running container: error creating container for [/bin/ash]: : exit status 1
# buildah run --no-pivot $container ash
/ # apk add python
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/10) Installing libbz2 (1.0.6-r6)
(2/10) Installing expat (2.2.5-r0)
(3/10) Installing libffi (3.2.1-r4)
(4/10) Installing gdbm (1.13-r1)
(5/10) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(6/10) Installing ncurses-terminfo (6.1_p20180818-r1)
(7/10) Installing ncurses-libs (6.1_p20180818-r1)
(8/10) Installing readline (7.0.003-r0)
(9/10) Installing sqlite-libs (3.24.0-r0)
(10/10) Installing python2 (2.7.15-r1)
Executing busybox-1.28.4-r1.trigger
OK: 51 MiB in 23 packages
/ # exit
# buildah commit $container alpine-python
Getting image source signatures
Skipping fetch of repeat blob sha256:df64d3292fd6194b7865d7326af5255db6d81e9df29f48adde61a918fbd8c332
Copying blob sha256:79cf48ca68bf27b54c922e394bfdf3f7d93bc309e4ca3e9c647caa14e2f4eeb1
 12.37 MiB / 12.37 MiB [====================================================] 0s
Copying config sha256:433dc09a3d44ffbfc433dbd353944d15e2b41a561dcf6a410a8650521626def6
 702 B / 702 B [============================================================] 0s
Writing manifest to image destination
Storing signatures
433dc09a3d44ffbfc433dbd353944d15e2b41a561dcf6a410a8650521626def6
# buildah images
IMAGE ID             IMAGE NAME                                               CREATED AT             SIZE
196d12cf6ab1         docker.io/library/alpine:latest                          Sep 11, 2018 22:19     4.67 MB
433dc09a3d44         localhost/alpine-python:latest                           Oct 5, 2018 22:23      48.4 MB
# podman images
REPOSITORY                 TAG      IMAGE ID       CREATED          SIZE
localhost/alpine-python    latest   433dc09a3d44   45 seconds ago   48.4MB
docker.io/library/alpine   latest   196d12cf6ab1   3 weeks ago      4.67MB
# exit
logout

Opened containers/buildah#1071 for --no-pivot, same thing as $DOCKER_RAMDISK

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 5, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: afbjorklund
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: tstromberg

If they are not already assigned, you can assign the PR to them by writing /assign @tstromberg in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 5, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 5, 2019
@afbjorklund afbjorklund mentioned this pull request Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants