2016-06-02 17 views
0

Befehl docker run leeren Container erstellen. Ich meine, dass Docker-Image erfolgreich erstellt, aber wenn ich Container ausführen, gibt es keine meine Änderungen. Ich arbeite an Ubuntu 16.04 mit Landstreicher. Meine Docker-Datei:Befehl Docker ausführen leeren Container erstellen

FROM node:6.2.0-wheezy 

MAINTAINER Lukasz Migut 

RUN mkdir -p /app 

ADD package.json /app/package.json 

RUN cd /app/ && \ 
npm cache clear && \ 
npm install --no-bin-links --quiet 

RUN mkdir -p /var/www/backend 

WORKDIR /var/www/backend 

COPY entrypoint.sh /entrypoint.sh 

CMD ["/bin/bash", "/entrypoint.sh"] 

EXPOSE 8080 

Dies wird ausgegeben, nachdem docker build .

Sending build context to Docker daemon 6.144 kB 
Step 1 : FROM node:6.2.0-wheezy 
6.2.0-wheezy: Pulling from library/node 
47994b92ab73: Already exists 
a3ed95caeb02: Already exists 
9b7b75987c3c: Already exists 
d66c4af59bfb: Already exists 
26df7d6a7371: Already exists 
b656b9b4e7eb: Already exists 
e3753c84bc68: Already exists 
Digest:  sha256:9a04df0cd52487e2fb6d6316890380780209f9211f4767934c5f80f2da83a6bf 
Status: Downloaded newer image for node:6.2.0-wheezy 
---> ecbd08787958 
Step 2 : MAINTAINER Lukasz Migut 
---> Running in 2a1d31015aea 
---> 6d6ff7769ec5 
Removing intermediate container 2a1d31015aea 
Step 3 : ADD package.json /app/package.json 
---> 5a28cc87577c 
Removing intermediate container 3df429908e6c 
Step 4 : RUN cd /app/ &&  npm cache clear &&  npm install --no- bin-links --quiet 
---> Running in 1fc442eb449a 
npm info it worked if it ends with ok 
npm info using [email protected] 
npm info using [email protected] 
npm info ok 
[email protected] /app 
`-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
| +-- [email protected] 
| `-- [email protected] 
+-- [email protected] 
+-- [email protected] 
| `-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
| +-- [email protected] 
| +-- [email protected] 
| | +-- [email protected] 
| | `-- [email protected] 
| | `-- [email protected] 
| `-- [email protected] 
`-- [email protected] 

---> ad5bf17db156 
Removing intermediate container 1fc442eb449a 
Step 5 : WORKDIR /var/www/backend 
---> Running in 3f75e64f3880 
---> 477162d999c0 
Removing intermediate container 3f75e64f3880 
Step 6 : COPY entrypoint.sh /entrypoint.sh 
---> b0918e5611e2 
Removing intermediate container b1c46f9175dd 
Step 7 : CMD /bin/bash /entrypoint.sh 
---> Running in fd2c72465c11 
---> 275911ac22ca 
Removing intermediate container fd2c72465c11 
Step 8 : EXPOSE 8080 
---> Running in d54c25afb6a1 
---> f4ba799427cc 
Removing intermediate container d54c25afb6a1 
Successfully built f4ba799427cc 

Befehl docker images

REPOSITORY   TAG     IMAGE ID   CREATED    SIZE 
<none>    <none>    f4ba799427cc  28 minutes ago  514.2 MB 
node    6.2.0-wheezy  ecbd08787958  8 days ago   503.9 MB 

Weiter versuche ich Container zu laufen mit docker run -it node:6.2.0-wheezy /bin/bash und wenn ich auf Behälter anmelden i can‘ t siehe zum Beispiel erstellte Ordner von Dockerfile und keine Knotenmodule.

Was mache ich falsch, warum kann ich keine Änderungen sehen?

Antwort

7

Sie haben ein Bild erstellt ... es ist das mit "< keine>" im Befehl docker images. Wenn Sie jedoch versucht haben, einen Container auszuführen, haben Sie das alte Image verwendet, auf dem Sie Ihr neues Image erstellt haben. Deine Änderungen sind in diesem neuen Bild, nicht in dem alten.

Um es Ihnen zu arbeiten, haben Sie Ihr neues Bild mit einem Namen zu markieren, und diesen Namen ...

docker build -t MYIMAGENAME . 
docker run -it MYIMAGENAME /bin/bash 
Verwandte Themen