markdown [Docker笔记] #Docker #tips #code

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown [Docker笔记] #Docker #tips #code相关的知识,希望对你有一定的参考价值。

*Run node docker container*

    $ docker run -it node bash

*Run node 6 docker container*

    $ docker run  -it node:6 bash

*Run node alpine docker container (small container, no bash)*

    $ docker run -it node:alpine bash

*Execute code inside a running container*

    $ docker exec -i -t <docker-id> bash

*List containers available*

    $ docker ps

*Mount current local folder in docker container*

    $ docker run -v ~/dev/hob-webshop-platform/frontend:/mnt -it node bash

*Launch a Docker Compose image*

    $ docker-compose up

*Launch Docker file in a local folder to create local Docker image (-t adds a nicer name to the Docker image)*

    $ docker build -t hob-platform/sting-frontend .

## Stuff to know…

- Docker Hub: [https://hub.docker.com](https://hub.docker.com/)
- All changes in the files in the container are lost when exiting- Docker compose: executes docker commands with nice YAML syntax (available in DockerHub)
- Example for docker compose: [https://docs.docker.com/compose/wordpress](https://docs.docker.com/compose/wordpress)

以上是关于markdown [Docker笔记] #Docker #tips #code的主要内容,如果未能解决你的问题,请参考以下文章

Docker笔记三 Docker镜像制作

Docker笔记三 Docker镜像制作

markdown MacOS将小垫片添加到Dock

nginx docker镜像学习笔记

markdown 删除隐藏的Dock用于MOOM的间隙

docker系统笔记-02容器快速上手