minte9
LearnRemember







Build

Clone some app, containing Dockerfile from GitHub.
 
# Clone the repo locally (nodejs web app)
cd /var/www/docker
git clone https://github.com/nigelpoulton/psweb
cd psweb
ls
    # app.js  circle.yml  Dockerfile  package.json  ...

# View contents of Dockerfile
cat Dockerfile
    # Test web-app to use with Pluralsight courses 
    # and Docker Deep Dive book
    # Linux x64
    # Install Node and NPM
    # RUN apk add --update nodejs npm curl
    # ...
Build an image from Dockerfile.
 
docker image build -t test:latest .
    # Sending build context to Docker daemon  158.7kB
    # Step 1/8 : FROM alpine
    # latest: Pulling from library/alpine
    # ...
    
docker image ls
    # REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
    # test         latest    58188456312c   3 minutes ago   81.9MB
    # ubuntu       latest    d2e4e1f51132   8 days ago      77.8MB
    # alpine       latest    0ac33e5f5afa   4 weeks ago     5.57MB
    
docker container run -d --name web1 --publish 8080:8080 test:latest
    # http://localhost:8080



  Last update: 302 days ago