coolify: [Bug]: Build Environment Variables passed to Dockerfile buildpack

Description

Heyo!

I created a resource with a “Dockerfile” build pack where i put all of my Environment Variables, which should be included at Build Time with the flag “Build Variable?” checked. These Environment Variables are not being included in the build process, as you can see in the logs below. What am i doing wrong? Do i need to do something else to include these Environment Variables in the build process? Thanks for the help 🙏

#15 [builder 6/8] RUN echo -e "\e[1;33mENVIRONMENT VARIABLES\e[0m"
[2024-Apr-02 08:47:00.447127]
COMMAND:
docker exec h4sgwcc bash -c 'bash /artifacts/build.sh'

OUTPUT:
#15 0.468 -e ENVIRONMENT VARIABLES
[2024-Apr-02 08:47:00.683328]
COMMAND:
docker exec h4sgwcc bash -c 'bash /artifacts/build.sh'

OUTPUT:
#15 DONE 0.5s

#16 [builder 7/8] RUN env
[2024-Apr-02 08:47:00.788315]
COMMAND:
docker exec h4sgwcc bash -c 'bash /artifacts/build.sh'

OUTPUT:
#16 0.260 NODE_VERSION=20.12.0
#16 0.260 YARN_VERSION=1.22.19
#16 0.260 HOME=/root
#16 0.260 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#16 0.260 WIREIT_LOGGER=simple
#16 0.260 PWD=/app
#16 0.260 NODE_ENV=production
[2024-Apr-02 08:47:00.893188]
COMMAND:
docker exec h4sgwcc bash -c 'bash /artifacts/build.sh'

OUTPUT:
#16 DONE 0.3s

Minimal Reproduction (if possible, example repository)

No response

Exception or Error

No response

Version

v4.0.0-beta.248

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 3
  • Comments: 16 (4 by maintainers)

Most upvoted comments

  • We should add a checkbox in the developer view to set all variables as build variables at once.
  • Also test if you paste the envs in the developer view and then switch to normal and set them as build variables if that is working correctely.

same, issue with v4.0.0-beta.323, it ignores the ENV statement when is run in coolify. Minimal Dockerfile:

FROM python:3.11

# Install Poetry
ENV POETRY_HOME=/opt/poetry
ENV PATH="$PATH:$POETRY_HOME/bin"
RUN curl -sSL https://install.python-poetry.org | python3 - --version 1.8.3

# Test poetry is found
RUN echo $(poetry --version)

I will add a small fix to the next version.