Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build args should be preserved during the livepush #42

Open
CameronDiver opened this issue May 29, 2019 · 1 comment
Open

Build args should be preserved during the livepush #42

CameronDiver opened this issue May 29, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request Medium priority

Comments

@CameronDiver
Copy link
Contributor

This is possible by looking at the image history. If we look at the first entry into the history array returned for an image (we call it once per stage) we can then parse out the values of the build arguments which created this layer, and apply it to every step in the stage. We may not even need to parse the arguments and instead send them directly to the shell which is executing the update command.

An extension to this would be to find the layer we are currently executing in the history list, and only apply the arguments which were defined at that point.

@CameronDiver CameronDiver added enhancement New feature or request Medium priority labels May 29, 2019
@CameronDiver CameronDiver self-assigned this May 29, 2019
@DaneSlattery
Copy link

I could definitely use this. In this example Dockerfile.template:

FROM balenalib/%%BALENA_ARCH%%-debian-dotnet:7.0-sdk as sdk

ARG BUILD_CONFIGURATION=Release

WORKDIR /usr/src/app
COPY ./ConsoleApp1 ./ConsoleApp1
RUN dotnet publish ConsoleApp1/ConsoleApp1.csproj -c ${BUILD_CONFIGURATION} -o publish

FROM balenalib/%%BALENA_ARCH%%-debian-dotnet:7.0-run as run

WORKDIR /usr/src/app

COPY --from=sdk /usr/src/app/publish .

CMD [ "dotnet", "ConsoleApp1.dll"]

When I change some code in the ConsoleApp project, dotnet publish step fails because the $BUILD CONFIGURATION argument is not available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Medium priority
Projects
None yet
Development

No branches or pull requests

2 participants