简体   繁体   中英

Use linux commands in Docker file and build on windows

I am a beginner in Docker and I have a situation here. My docker file looks like this.

FROM python:3.6-alpine

#Copy contents
COPY . /srv/flask_app
WORKDIR /srv/flask_app

#Get essentials to base image
RUN apt-get clean \
    && apt-get -y update

RUN apt-get -y install nginx \
    && apt-get -y install python3-dev \
    && apt-get -y install build-essential

RUN pip install -r requirements.txt --src /usr/local/src

COPY nginx.conf /etc/nginx
RUN chmod +x ./start.sh

CMD ["./start.sh"]

When I am trying to build the docker file on windows, it is giving me an error saying the Linux command can't be found. How can I build a docker specific to Linux, on windows?

you are on alpine , you should use apk not apt-get .

apt-get is the package management for Debian baised systems.

you can also change the base image then do not need to change any commands:

FROM python:3.6-buster

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM