docker-for-windows

Can't install pip packages inside a docker container with windows

时光怂恿深爱的人放手 提交于 2020-08-10 18:53:28
问题 Dockerfile # Use an official Python runtime as a base image FROM python:3.8.1-windowsservercore # Set the working directory to /app WORKDIR /app # Copy the current directory contents into the container at /app ADD . /app # Install any needed packages specified in requirements.txt RUN pip install --trusted-host pypi.python.org -r requirements.txt # Make port 80 available to the world outside this container EXPOSE 80 # Define environment variable ENV NAME World # Run app.py when the container

Docker port mapping is not working on windows 10

佐手、 提交于 2020-08-02 17:48:46
问题 I am new to docker. I am trying to get a simple node app running on docker. However I am facing an issue with the docker port publish. Docker version - 18.03.0-ce, build 0520e24302 My simple app code: 'use strict'; const express = require('express'); // Constants const PORT = 8081; const HOST = '0.0.0.0'; // App const app = express(); app.get('/', (req, res) => { res.send('Hello world\n'); }); app.listen(PORT, HOST); console.log(`Running on http://${HOST}:${PORT}`); My docker file: FROM node