Docker Community Forums

Share and learn in the Docker community.

Docker file error


(Baharul1) #1

Hi All,

I am having below docker file. Docker is running on Windows server system 2016

FROM java:8
ADD target\course-api-0.0.1-SNAPSHOT.jar testAPI.jar
ENTRYPOINT [“java”,"-jar","\testAPI.jar"]

But getting below error on docker build

C:\Users\Administrator\Documents\Spring_Boot_Test\course-api>docker build -t microservice:latest .
Sending build context to Docker daemon 43.52kB
Step 1/3 : FROM java:8
8: Pulling from library/java
image operating system “linux” cannot be used on this platform.

Can anyone please help to resolve the issue.

Thanks
Baharul Islam


(Jayeshkulkarni) #2

It clearly says “image operating system “linux” cannot be used on this platform.”

Means java:8 image which you are importing is based on Linux. You can not use linux image on windows. You either have to pull nanoserver image or windowsservercore image and install java on it before using it.