I have to build and android application using docker image in a windows machine using command lines , without opting with docker desktop or virtual machine , just I need to use my local windows machine to run it
I tried to use docker diamon to be able to make the container up running using those commands :
Enable-WindowsOptionalFeature -Online -FeatureName containers –All
dockerd -H tcp://localhost:2376 --data-root D:ProgramDatadocker
And they works fine without any issue
And then I tried to run a the docker file to be able to download the required image and build this image into this container ,
docker build --file "D:Dockerizationbuild-apex.Dockerfile" --build-arg BASE_DIR=. . -t app-
build:latest
Sending build context to Docker daemon 3.33GB
Step 1/18 : FROM openjdk:11-jdk
---> c18b9b54de01
Step 2/18 : ARG BASE_DIR
---> Using cache
---> fdd7eaf533b1
Step 3/18 : RUN apt-get update
---> Running in f4952a55c7f5
apt-get : The term 'apt-get' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At line:1 char:76
+ ... ce = 'Stop'; $ProgressPreference = 'SilentlyContinue'; apt-get update
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (apt-get:String) [], ParentConta
insErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException
The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference =
'SilentlyContinue'; apt-get update' returned a non-zero code: 1
this is my docker file
FROM openjdk:11-jdk
ARG BASE_DIR
RUN apt-get update
RUN apt-get install -y curl unzip
RUN apt-get install -y python3 python3-distutils
RUN apt-get install -y xsltproc
RUN rm -rf /var/lib/apt/lists/*
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py &&
python3 get-pip.py &&
rm get-pip.py
ENV ANDROID_HOME /opt/android-sdk-linux
ENV PATH ${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-
tools:${ANDROID_HOME}/tools/bin
# Download and install Android SDK
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools &&
cd ${ANDROID_HOME}/cmdline-tools &&
curl -o sdk-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-
6858069_latest.zip &&
unzip sdk-tools.zip &&
mv cmdline-tools latest &&
rm sdk-tools.zip
# Accept Android SDK licenses
RUN yes | sdkmanager --licenses
# Install necessary Android SDK components
RUN sdkmanager "platforms;android-29" "build-tools;29.0.3"
Normally openjdk:11-jdk image has a linux container , so if I need to use it , I will be able to run linux commands
So why I have got this issue and what is the solution to resolve this problem