This is the 13th day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021

A week passed in a twinkling. Yuan Xiaobai shared the twists and turns of the week and his understanding of code structure at the regular meeting on Friday. Longfei also carried out a supplement. Jia Dazhi see everyone’s enthusiasm, full of praise for two people. But there are not too many updates on the code, which makes Yuan Xiaobai dissatisfied. I thought, longfei and I have spent so much time on the code, we are making good progress, and your code related, no update, it is not fair ah.

Zhou Wei Yuan Xiaobai was idle and bored, and the question raised by Long Fei appeared in his mind: what is the relationship between data structures?

With this question, Yuan Xiaobai thought, now see dockerfile.build, in which there are three places are related to data.

One is to convert dockerfile to SRC. Although we haven’t seen the implementation details here, it looks like converting dockerfile to LLB:

Another is dockerfiel2llb. Dockerfile2LLB:Here can not help but let Yuan Xiaobai a little confused, the front is not already turned, why this place also turn again? Are they different?

The end of the day, this place source since dockerfile2llb dockerfile2llb, because there is a dependent, that is in the parameterdtDockerfileThe []byte type loads the dockerfile from the hard disk into memory. Where is this prepared?Figuring out how this information is read, though, solves a problem. But three questions arise: why is c. plunge here again? Why take res.singleref out? What is ref?

Although there are many problems now, but the most let Yuan Xiaobai want to know, or this mysterious LLB, because all the problems seem to have some connection with this LLB, what is LLB?

The current understanding of LLB seems to be close to zero, as even jia Dazhi’s interpretation of the general structure does not mention this area. It is unbelievable that such an important module is not explained!

Yuan Xiaobai soon found the location of LLB, which was under the client package:

Looking at so many new files, it makes Yuan Xiaobai feel that he has entered another meta-universe…

Happily, though, there are a lot of files that end with _test. Once you get used to TDD, it feels like a different type of document that not only explains a lot of information, but can also be used to execute and answer questions.

But Yuan Xiaobai soon found that these are some partial tests, and did not let himself have a global understanding, what is LLB exactly? Through the global search, Yuan Xiaobai seems to see hope:In buildkit0, this is exactly how LLB is used, which looks like a way to organize lines of instructions in a dockerfile in a different way, and to sort out relationships between multiple Dockerfiles at the same time!

The Moby Buildkit series # 14-LLB is not simple