ComputerGuy123
ComputerGuy123

Reputation: 237

docker: removing file/image dependencies on other docker images

How do you remove files dependencies from a docker image? Everytime I build and upload a new docker image it takes layers and information from past images. How do I remove this connection so that all docker builds are independent from all others images.

Eg: I had a working file, and when I reuploaded it with no changes it stopped working and since then, I can't reupload a working file.


dockerfile:

FROM 10.119.222.132:5000/node:8.5.0-wheezy

ENV http_proxy=http://www-proxy.abc.ca:3128/
ENV https_proxy=http://www-proxy.abc.ca:3128/

ENV PORT 5000

RUN apt-get update

WORKDIR /usr/src/app
COPY package.json /usr/src/app
COPY . .  

CMD ["node", "server.js"]

package.json:

{
  "name": "api-proxy",
  "version": "1.0.0",
  "description": "API Gateway",
  "main": "server.js",
  "dependencies": {
    "body-parser": "^1.17.2",
    "crypto": "^1.0.1",
    "cors": "^2.8.4",
    "express": "^4.15.4",
    "jsonwebtoken": "^7.4.2",
    "mongodb": "^2.2.31",
    "request": "^2.81.0"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "author": "",
  "license": "ISC"
}

Upvotes: 2

Views: 329

Answers (1)

Sergiu
Sergiu

Reputation: 3185

You could build it using

docker build --no-cache my_new_image:v1.0.0 .

Upvotes: 1

Related Questions