Skip to content

Make ENV instructions from Dockerfile work as env variable in walt image #134

@finieluga

Description

@finieluga

How to reproduce:

  • Create a Dockerfile with an ENV instruction to define an environment variable (e.g., modifying the PATH).
  • Build the image using the walt image build command.
  • Boot a node using the newly built image via walt node boot.
  • Connect to the node using walt node shell.
  • Check the environment variable with a command like echo $PATH.

Expected behavior:

The environment variable defined via the ENV instruction should be available in the shell when connected to the node.

Actual behavior:

The environment variable is not set or updated when connecting to the node shell.

Investigation:

In Docker, the ENV instruction adds metadata to the image (visible with docker image inspect), but it does not directly modify files in the image filesystem.

As a workaround, the environment variable can be explicitly set in the image by modifying the .bashrc file.

Suggested improvement:

Automatically generate a script in /etc/profile.d/ during the image build process to expose environment variables defined via ENV instructions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions