Docker Base Image not found when using compiler

16 ビュー (過去 30 日間)
SG
SG 2021 年 7 月 14 日
編集済み: BJ Kowalski 2022 年 10 月 14 日
I am using compiler.package.docker function. I am following the Package Standalone Application example. But it is not working and giving me the following error:
Error using compiler.internal.package.docker.generateBaseImage (line 26)
When creating the base image, 'docker build' failed with the following log:
unable to prepare context: path "/tmp/ubuntu/matlabruntime/docker/r2020b/release/update0/baseimage" not found
Error in compiler.internal.package.docker.generateRuntimeImage (line 15)
compiler.internal.package.docker.generateBaseImage
Error in compiler.package.docker (line 123)
compiler.internal.package.docker.generateRuntimeImage(prodnums)
I have checked all prerequisites. I have Docker installed on my machine, I have checked the MATLAB runtime is installed using the compiler.runtime.download function.
Any ideas?

回答 (1 件)

BJ Kowalski
BJ Kowalski 2022 年 10 月 14 日
編集済み: BJ Kowalski 2022 年 10 月 14 日
I encountered this same problem with a new installation of Ubuntu 22.04.1 LTS using R2022a or R2022b.
I performed the same checks as specified by SG. What I believe was missed is that the Docker service was not running.
Most likely, the docker commands were installed but not the service. I used a snap to install Docker.
sudo snap install docker
But that snap does not include the Docker services. Run the following command to verify that Docker services are not available:
sudo systemctl status docker
That will report "Unit docker.service could not be found.". To add the Docker services I followed the instructions from a tutorial on HowtoForge.com titled "How to create Docker Images with a Dockerfile on Ubuntu 20.04 LTS", While this is listed as Ubuntu 20.04 LTS the instructions for the services also apply to 22.04 LTS.
I executed the following commands:
sudo apt update
sudo apt install docker.io
sudo systemctl start docker
sudo enable docker
After enabling the Docker services I was able to successfully build my container.
NOTE: The container will be built with a Ubuntu 20.04 base image.

カテゴリ

Help Center および File ExchangeContainers についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by