Skip to content

How I fixed my 1-Click Packer build #184

Description

@Cristy94

I am working on my 1-Click App, and I spent 1 week trying to make, using Packer, an image that actually works.

I am deploying from Windows, and I had to fix multiple issues from the current template/guide.

Those were the fixes I had to debug and implement:

  • Add rm -rf /opt/digitalocean to 90-cleanup.sh
  • Use ubuntu-20-04 because with ubuntu-22-04 packer fails SSH connection
  • Fix CRLF/LF newline issues. I wrote my scripts and ran packer on Windows, when uploading the newline characters where wrong. I had to make sure all scripts/files have the right LF line endings.
  • Fix file permissions. The 001_onboot and 99-one-click MOTD scripts were not executed, because files copied by packer don't have execute permissions.
    I have added this to marketplace-image.json, after the files are copied:
        {
          "type": "shell",
          "inline": [
            "chmod +x /var/lib/cloud/scripts/per-instance/001_onboot",
            "chmod +x /etc/update-motd.d/99-one-click"
          ]
        },
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions