Giter Site home page Giter Site logo

docker's Introduction

Docker 2023

Each subdirectory holds a different Dockerfile for various builds.

During the build process, the docker image is given the same name as the subdirectory housing the build file.

Build command

cd path-of-subdirectory
../build 

Include option --progress=plain to print verbosely.

Include option --no-cache to clear your local docker build cache.

Run commands

cd path-to-your-files
docker run -it -v /"${PWD}":/home/user/work    docker-image-name

The option -v /"${PWD}":/home/user/work causes your files in the current directory to be mounted at /home/user/work inside the container. Any changes made inside the container will change the files that are outside the container.

The option -it puts you in an interactive tty terminal.

Include option -name container-name to give your container a name

Include option -rm to delete the container upon exit (and start anew the next time).

Include option -u 0 to have root access inside the container

Include option -p port_outside:port_inside for each TCP/IP port that is needed.

Once inside the container, type the following to verify the versions of commands in use:

info

Connecting to a Container with VS Code

https://code.visualstudio.com/docs/devcontainers/attach-container

To attach to a Docker container, either

  • Step 1: Hit F1 by and type Dev Containers: Attach to Running Container... in the Command Palette

image

image

  • or use the Remote Explorer in the Activity Bar and from the Containers view, select the Attach to Container inline action on the container you want to connect to.

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.