如何从OpenEmbedded为Yocto项目添加docker-ce?新手遇ERROR报错求助
Hey Ian, sorry you hit this snag while waiting for your book—let’s get docker-ce added to your project properly. The error you’re seeing almost always boils down to missing the right layer or a misconfiguration in your build setup. Here’s a step-by-step breakdown to fix it:
1. Add the Required Layer
Docker-ce lives in the meta-oe layer within the meta-openembedded collection. First, make sure you’ve cloned this layer into your Yocto workspace:
# Clone the meta-openembedded repo (adjust the path to match your workspace structure) git clone git://git.openembedded.org/meta-openembedded ../layers/meta-openembedded
Then, switch to the branch that matches your Yocto release (e.g., kirkstone, dunfell—critical for compatibility):
cd ../layers/meta-openembedded git checkout kirkstone # Replace with your Yocto version's branch
2. Update Your Layer Configuration
Next, edit your build's bblayers.conf file (usually in build/conf/bblayers.conf) to include the meta-oe layer. Add this line to the BBLAYERS list:
${TOPDIR}/../layers/meta-openembedded/meta-oe \
Double-check the path is correct relative to your build directory.
3. Add docker-ce to Your Image
Now, tell Yocto to include docker-ce in your target image. Open build/conf/local.conf and add:
IMAGE_INSTALL_append = " docker-ce"
The _append ensures you don’t overwrite existing packages in your image definition.
4. Verify and Rebuild
Run your bitbake command again (e.g., bitbake core-image-minimal). The error should be gone now—Yocto will pull in docker-ce and all its dependencies from the meta-oe layer.
Quick Troubleshooting Tips
- If you still get the error, double-check that your meta-openembedded branch matches your Yocto release. Mismatched branches often cause package not found issues.
- Some older Yocto releases might use
dockerinstead ofdocker-ce—try swapping the package name inIMAGE_INSTALL_appendif needed.
Hope this gets you up and running before your book arrives!
内容的提问来源于stack exchange,提问作者JackRazors

