Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6093

VirtualBox Ubuntu: "failed to read dockerfile open /var/lib/docker/tmp/buildkit... no such file or directory"

$
0
0

I have the simplest hello world Java application. Its filesystem:

|-- HelloWorld   |-- src      |-- Main.java   |-- Dockerfile

I use VirtualBox 7.0 with Ubuntu x64 and Docker 24.0.5.

When I try to build the application image from that Dockerfile using this command:

docker build -t hello .

I get this error:

root@ubuntu: /media/sf_IdeaProjects/HelloWorld# docker build -t hello.[+] Building 0.1s (2/2) FINISHED=> [internal] load build definition from Dockerfile=> [internal] load .dockerignore=> => transferring dockerfile: 2B=> => transferring context: 2BERROR: failed to solve: failed to read dockerfile: open /var/snap/docker/common/var-lib-docker/tmp/buildkit-mount1689060805/Dockerfile: no such file or directory

The "IdeaProjects" folder is shared with the VirtualBox guest OS.

Dockerfile

FROM openjdk:17-alpineWORKDIR /appCOPY ./src .RUN javac Main.java CMD ["java", "Main"]

Main.java

public class Main {    public static void main(String[] args) {        System.out.println("Hello world!");    }}

Viewing all articles
Browse latest Browse all 6093

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>