Image
and container
image
-> templatecontainer
-> realized runtime instanceimages
Docker run
go deeper-i
: Keep STDIN open even if not attached-t
: Allocate a pseudo-TTY-d
: Run container in background and print container ID-v
: Bind mount a volume
-v /home/xx:/home/xx -v /home/app:/app
-p
: Publish a container’s port(s) to the host
-p 8000:8000 -p 5000:80
-w
: Working directory inside the container--rm
: Automatically remove the container when it exits--ipc
: IPC mode to use
--ipc=host
--name
: Assign a name to the container--privileged
: Give extended privileges to this container
--gpus
: Specify which GPUs (or all) to use
--gpus all
--shm-size
: Size of /dev/shmnumpy
with python:3.9
imageDockerfile
and build your image!Then
FROM
FROM <image name>
FROM <image name>:<tag>
WORKDIR
WORKDIR <path>
RUN
RUN <command>
COPY
COPY [--chown=<user>:<group>] <source path> <dist path>
CMD
CMD [“command name”, argv1, argv2, …]
CMD <command>
ENTRYPOINT
ENTRYPOINT <command>
CMD
EXPOSE
Expose <PORT1> <PORT2> ...
ENV
ENV <key> <value>
ENV <key1>=<value1> <key2>=<value2>
ARG
ARG <arg>
docker build --build-arg <arg>=...
Please skip the explanation part if you are a novice!
clang 12.0.0 -O1
clang 14.0.0 -O1
segment-anything
frontend serviceRecommand to see the source code if you are (going to be) a ReactJS developer
Prepare a docker file
Then
segment-anything
frontend service with NGINX load balancerThen
It is troublesome to configurate something like port
, mount
, and network
every time with docker command!
docker-compose.yml
Only basic configurations are mentioned here; please see the document for the details.
Or
Dockerfile
& docker-compose.yml
for project/researchdocker
package (docker SDK)asyncio
and aiohttp
requests
or aiohttp
async/await