I am new into docker.
I am using linux to run docker. Docker successfully installed. But
When I run docker command sudo docker build . I always getting the error. How can i solve the issue?
My docker file is
FROM node:14
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "node", 'app.mjs' ]
Nodejs package.json file
{
"name": "1_getting-_started_docker",
"version": "1.0.0",
"description": "",
"main": "app.mjs",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.17.1"
}
}
app.mjs
import express from 'express'
import { connectToDatabase } from './helpers.mjs';
const app = express();
app.get('/', (request, response) => {
response.send('<h1>Hi there</h1>');
});
await connectToDatabase();
// https://robinwinslow.uk/fix-docker-networking-dns
