Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

how to make img for ranchervm? #140

Open
ruanshudong opened this issue Aug 26, 2019 · 2 comments
Open

how to make img for ranchervm? #140

ruanshudong opened this issue Aug 26, 2019 · 2 comments

Comments

@ruanshudong
Copy link

in example , docker was created like this:
[root@mirror centos]# make build
docker build --build-arg BASE_IMAGE=centos7.0.qcow2 -t rancher/vm-centos:1 .
Sending build context to Docker daemon 4.296GB
Step 1/3 : FROM scratch
--->
Step 2/3 : ARG BASE_IMAGE
---> Using cache
---> b8fd05b49a47
Step 3/3 : COPY ${BASE_IMAGE} /base_image/${BASE_IMAGE}
---> d0ffb95143d7
Successfully built d0ffb95143d7
Successfully tagged rancher/vm-centos:1
[root@mirror centos]# ls
centos7.0.qcow2 Dockerfile Makefile
[root@mirror centos]# cat Dockerfile
FROM scratch
ARG BASE_IMAGE
COPY ${BASE_IMAGE} /base_image/${BASE_IMAGE}

i create img, k8s pull the docker file failed, kubectl describe pod pull-centos-1-172.16.124.203:

Error: failed to start container "pull": Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: "/bin/sh": stat /bin/sh: no such file or directory": unknown

Should i modify Dockerfile to this?
FROM rancher/vm-base
ARG BASE_IMAGE
COPY ${BASE_IMAGE} /base_image/${BASE_IMAGE}

@Oats87
Copy link

Oats87 commented Aug 26, 2019

Try

FROM alpine

instead of scratch

@ruanshudong
Copy link
Author

I modify Dockerfile to:
FROM rancher/vm-base

it seems work fine!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants