Building the simplest docker image and it fails to run

Hi,

I’m trying to build a simple image with no new additions, on top of ubuntu:jammy. If I run docker run -it ubuntu:jammy I get the bash prompt. However, if I run my image build on top of it without adding anything to the image, then when docker run -it <myimageid> I get the following error:

docker run -it 09db9daa8aa9
/bin/bash: 3: Syntax error: Unterminated quoted string

Based on the additional info below, does anyone have any ideas why this is failing? It seems trivial to me :slight_smile:

Below is my packer file and and other system specs. Note that I also downloaded and ran Google’s container-diff tool and it reports the following:

 $ container-diff diff daemon://ubuntu:jammy daemon://mw-ansible-controller 

-----Size-----

Image size difference between ubuntu:jammy and mw-ansible-controller: None

$ container-diff diff daemon://ubuntu:jammy daemon://mw-ansible-controller --type=file

-----File-----

These entries have been added to ubuntu:jammy:
FILE                 SIZE
/packer-files        0

These entries have been deleted from ubuntu:jammy: None

These entries have been changed between ubuntu:jammy and mw-ansible-controller: None

Host OS: - Ubuntu 23.10 (mantic)
Packer Version: v1.10.2

Here is my packer file:

packer {
  required_plugins {
    docker = {
      version = ">= 1.0.8"
      source  = "github.com/hashicorp/docker"
    }
  }
}

source "docker" "ubuntu2204" {
  image  = "ubuntu:jammy"
  commit = true
}

build {
  name = "ansible-controller"
  sources = [
    "source.docker.ubuntu2204"
  ]
}

Any ideas would be greatly appreciated!

Regards

1 Like

Did you figure this out? I tried this today straight out of the official tutorial both in Ubuntu (latest, fresh install) and windows. Same error in both cases. Also breaks with alpine etc, so it’s not base image related.

I couldn’t figure out why it isn’t working. Maybe something to do with some default start options packer adds that may have a bug.

However, I did get my container working by adding an explicit custom script entry point I wrote rather than relying on the one inherited from the parent:

source "docker" "ubuntu" {
  image  = "ubuntu:jammy"
  commit = true
  changes = [
    "ENTRYPOINT [\"/usr/local/bin/default-entry-point.sh\"]",
    "WORKDIR /mw/ansible-work"
  ]
}

HTH

I JUST figured it out like 5 minutes ago. If you don’t say >= 1.0.8 for the plugin version but specify 1.0.8 it works. Something in the recently released 1.0.9 is causing the issue. Try that.

1 Like

Wow, great detective work!