Skip to content

[Bug]: ansible feature failes with Exec format error (Missing shebang) #202

@morgan-lindqvist

Description

@morgan-lindqvist

Feature id and version

ghcr.io/devcontainers-extra/features/ansible:2

Dev Container base Image

mcr.microsoft.com/devcontainers/base:trixie

What happened?

When building a multi architechture (linux/amd64, linux/arm64/v8) devcontainer (devcontainer.json se below) on linux/amd64 the build fails when adding the ansible feature with the error message below.

Building a single architechture build for amd64 on amd64 works fine

Looking at the install.sh for the ansible featue the shebang is missing (https://github.com/devcontainers-extra/features/blob/main/src/ansible/install.sh)

The guidelines for writing a feature (https://containers.dev/guide/author-a-feature) clearly shows that there should be a sheband in first line.

If I fork the repository and add a shebang on the first line and them deploys the feature locally the devcontainer builds without any issues.

The shebang was removed for the ansible feature as well as for a number of other features i this commit: 756258d

The devcontaainer.json looks as follows (written from memory so there might be a typo but I do not think so)
{ "image": "mcr.microsoft.com/devcontainers/base:trixie", "features": { "ghcr.io/devcontainers-extra/features/ansible:2": {} } }

Proposal: Add the shebang back for all the features it was removed from or make sure install.sh can be executed without it.

Relevant log output

Error while loading /tmp/dev-container-feature/ansible_0/./install.sh: Exec format error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions