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

fix(docker): improve retrieval of layer id during inspect #400

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

YodaDaCoda
Copy link

Should fix microsoft/azure-pipelines-tasks#20506

Accounts for the change from #373 where layerId may or may not include an algorithm.

It appears that when a Dockerfile has a multiline RUN command, docker history outputs the createdBy property as-is, with newlines. This breaks retrieval of the layerId from the history, as the existing code splits the history by newline and attempts to find the layerId in the first line.

This change uses regex to find the first layerId mentioned in the history, regardless of newlines.

@YodaDaCoda YodaDaCoda requested review from manolerazvan and a team as code owners October 3, 2024 06:57
@YodaDaCoda
Copy link
Author

@microsoft-github-policy-service agree

@YodaDaCoda YodaDaCoda changed the title fix(docker): filter out empty layer ids during inspect fix(docker): improve retrieval of layer id during inspect Oct 4, 2024
@YodaDaCoda
Copy link
Author

or you could just split line-by-line, i'm sure that won't fail in new and exciting ways 😒

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REGRESSION]: Docker@2 fails - "docker inspect" requires at least 1 argument
1 participant