Code Monkey home page Code Monkey logo

docker-ci's Introduction

Docker Commands

docker build .

This looks for a Dockerfile within the CWD. To use a spcific file, like Dockerfile.dev a flag must be added: -f

docker build -f Dockerfile.dev .

docker run -it -p 4001:3000 -v /app/node_modules -v $(pwd):/app {DOCKER_IMAGE_ID}

  • -it keeps the terminal open
  • -p maps the input/local port (4001) to the container port (3000). To access the app we would have to go to our localhost:4001 on our end
  • -v sets up a volume of files. With no : it just bookmarks something on the container. With a : it creates a ref locally -- essentially overrides. So in this case, since we aren't copying over node_modules in our Dockerfile, we need to bookmark the one created on the container so we have access to dependencies when referencing everything else via -v $(pwd):/app.

docker ps

This will display a table with information regarding any up/running containers on the system. ID's can be grabbed from here to perfrom some exec or stop command.

docker exec -it sh or docker exec {some_command}

This allows us to execute commands on already running containers. Using sh as the command essentially keeps open a shell so we can run anything we would normally run via the terminal.

Docker Compose Commands

Run Docker Compose

docker-compose up

This looks for a docker-compose.yml file in the CWD and executes all the commands (see the yaml file for configuration)

docker-ci's People

Contributors

ehutchllew avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.