docker_redis_image
Docker Redis Image
| << Docker-compose | Docker Redis Performance >> |
|---|
Docker Redis Image
Dockerfile
📄 Dockerfile
- CMD: It will be specified at run time, so it was not used here.
- EXPOSE: It will be specified at run time, and the ports to use will be set in the redis.conf file, so it was not used here.
Build a Redis image
💻 Terminal
- The last period (.) is the location of the Dockerfile.
Run a Redis image
💻 Terminal
Connect with a shell
💻 Terminal
Connect with redis-cli
💻 Terminal
Dockerfile instructions
- FROM: Specifies the base image.
FROM image[:tag] [AS name] - MAINTAINER: Provides contact information for the person who created the image.
It can be replaced by Label.
MAINTAINER name - LABEL: Provides a label (description).
LABEL key=value - USER: Specifies the user. The default is root.
USER root - ENV: Specifies environment variables. It helps avoid repetitive work and prevent errors.
- VOLUME: Specifies a volume. You can mount a host directory onto this volume.
- A volume is a directory separated from the container's root file system.
- Volumes are managed directly by the Docker daemon and can be shared between containers.
- A volume can be used when mounting a host directory into a container.
- When a running container is updated into an image, the volume is not included in the update.
- Because a volume is a file system separate from the container, it is not included in the layers that make up the image. Therefore, reading from or writing to a volume is done directly without going through layers.
- If multiple containers use one volume, that volume is kept until all of those containers have stopped.
- WORKDIR: Specifies the working directory. RUN and CMD instructions run in the working directory.
- ADD: Copies host files into the image.
- COPY: Copies host files into the image. It is more limited than ADD.
- EXPOSE: Specifies the ports to use from outside the container.
It is used for links between containers, and you must connect it to a host port with RUN -p host_port:container_port. - RUN: Runs a command.
- CMD: A command that starts the process you want to run inside the container.
- ENTRYPOINT: Similar to CMD, but it is not overwritten by the RUN command.
ENTRYPOINT file or sh arg1 arg2 - ONBUILD
- STOPSIGNAL
- HEALTHCHECK
- SHELL
📄 Dockerfile
📄 Dockerfile
📄 Dockerfile
📄 Dockerfile
📄 Dockerfile
The following are characteristics of volumes.
📄 Dockerfile
📄 Dockerfile
📄 Dockerfile
📄 Dockerfile
📄 Dockerfile
📄 Dockerfile
📄 Dockerfile
| << Docker-compose | Docker Redis Performance >> |
|---|
Email
답글이 올라오면 이메일로 알려드리겠습니다.
