Create a docker image/container from EC2 AMI

后端 未结 3 449
旧巷少年郎
旧巷少年郎 2020-12-25 13:17

I am very new to docker and am trying to import my AWS EC2 AMI into a docker image. The image is a m2 linux image.

I have also setup a private docker hub(artifacto

3条回答
  •  梦毁少年i
    2020-12-25 13:41

    When creating the tar file cd to the directory and tar the tree from there.

    cd /media/my-external-drive
    tar -czvf /tmp/drive-image.tgz
    

    And then to create the image ...

    docker import /tmp/drive-image.tgz

    This allows the dockerized container to create the correct paths when you run it.

提交回复
热议问题