Make vagrant image from a docker container

23 views
Skip to first unread message

ajith u

unread,
Dec 3, 2018, 1:48:44 AM12/3/18
to packe...@googlegroups.com
Hi,
I am trying to make a vagrant image (.box)  from an ubuntu docker container using packer .
The json file is like this.

==================
{
  "builders": [
    {
      "type": "docker",
      "image": "ubuntu:latest",
      "commit": "true"

    }
  ],
"post-processors": [{
        "type": "vagrant",
        "output": "ubuntu-16.10-amd64-vagrant.box"
  }]

}

======================

the error i am getting is 
* Post-processor failed: Unknown artifact type, can't build box: packer.post-processor.docker-import

Please let me know if I am missing something

thanks,
Ajith.

Rickard von Essen

unread,
Dec 3, 2018, 2:10:16 AM12/3/18
to packe...@googlegroups.com
Which version of Packer are you using? What's the output of:
PACKER_LOG=1 packer build template.json 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAHGGiCTjkOYM95gDRyMeR4uQKpfzWac1D5NjhpX7_%3DbnYWTR%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

ajith u

unread,
Dec 3, 2018, 2:15:25 AM12/3/18
to packe...@googlegroups.com
I am using   Packer v1.2.5

this is the full error:
# PACKER_LOG=1
# packer build build.json
docker output will be in this color.

==> docker: Creating a temporary directory for sharing data...
==> docker: Pulling Docker image: ubuntu:latest
    docker: latest: Pulling from library/ubuntu
    docker: Digest: sha256:6d0e0c26489e33f5a6f0020edface2727db9489744ecc9b4f50c7fa671f23c49
    docker: Status: Image is up to date for ubuntu:latest
==> docker: Starting docker container...
    docker: Run command: docker run -v /root/.packer.d/tmp/packer-docker875001861:/packer-files -d -i -t ubuntu:latest /bin/bash
    docker: Container ID: 9ade6f732772f958afd565431604e122ae863248e22e4128bc43f5c143f1cd7c
==> docker: Committing the container
    docker: Image ID: sha256:68f4ad47213d19bf6241d8928ffe69810f5809d52fe8ee59ef2267d93934d531
==> docker: Killing the container: 9ade6f732772f958afd565431604e122ae863248e22e4128bc43f5c143f1cd7c
==> docker: Running post-processor: vagrant
Build 'docker' errored: 1 error(s) occurred:


* Post-processor failed: Unknown artifact type, can't build box: packer.post-processor.docker-import

==> Some builds didn't complete successfully and had errors:
--> docker: 1 error(s) occurred:


* Post-processor failed: Unknown artifact type, can't build box: packer.post-processor.docker-import

==> Builds finished but no artifacts were created.




For more options, visit https://groups.google.com/d/optout.


--

Rickard von Essen

unread,
Dec 3, 2018, 2:23:21 AM12/3/18
to packe...@googlegroups.com
The ful log with env var PACKER_LOG=1 should be much longer. 

ajith u

unread,
Dec 3, 2018, 3:19:47 AM12/3/18
to packe...@googlegroups.com
Hi,
The error is

==> docker: Killing the container: 07363904fc87b94d63c15dbbc1bbfa4b98e1997c5b7271ea5d29fb6f832d58c2
2018/12/03 13:47:08 [INFO] (telemetry) ending docker
2018/12/03 13:47:08 ui: ==> docker: Running post-processor: vagrant
2018/12/03 13:47:08 [INFO] (telemetry) Starting post-processor vagrant

==> docker: Running post-processor: vagrant
2018/12/03 13:47:08 [INFO] (telemetry) ending vagrant
2018/12/03 13:47:08 Deleting original artifact for build 'docker'
2018/12/03 13:47:08 packer: 2018/12/03 13:47:08 Deleting image: sha256:cf1612fd34c6b30e91a89bb0a075dce0f15cbd160129d0a7322e83d67876e2b7
2018/12/03 13:47:08 ui error: Build 'docker' errored: 1 error(s) occurred:


* Post-processor failed: Unknown artifact type, can't build box: packer.post-processor.docker-import
2018/12/03 13:47:08 Builds completed. Waiting on interrupt barrier...
2018/12/03 13:47:08 machine readable: error-count []string{"1"}
2018/12/03 13:47:08 ui error:

==> Some builds didn't complete successfully and had errors:
2018/12/03 13:47:08 machine readable: docker,error []string{"1 error(s) occurred:\n\n* Post-processor failed: Unknown artifact type, can't build box: packer.post-processor.docker-import"}
2018/12/03 13:47:08 ui error: --> docker: 1 error(s) occurred:


* Post-processor failed: Unknown artifact type, can't build box: packer.post-processor.docker-import
2018/12/03 13:47:08 ui:

==> Builds finished but no artifacts were created.
2018/12/03 13:47:08 [INFO] (telemetry) Finalizing.

Build 'docker' errored: 1 error(s) occurred:

* Post-processor failed: Unknown artifact type, can't build box: packer.post-processor.docker-import

==> Some builds didn't complete successfully and had errors:
--> docker: 1 error(s) occurred:

* Post-processor failed: Unknown artifact type, can't build box: packer.post-processor.docker-import

Attached full error log


For more options, visit https://groups.google.com/d/optout.
packer-error.txt
Reply all
Reply to author
Forward
0 new messages