article:linux:docker
                Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| article:linux:docker [2024/07/16 19:08] – créée Gary | article:linux:docker [2024/08/10 16:07] (Version actuelle) – [Cheatsheet - Docker Compose] Gary | ||
|---|---|---|---|
| Ligne 176: | Ligne 176: | ||
|   * [[https:// |   * [[https:// | ||
|   * [[https:// |   * [[https:// | ||
| + | |||
| + | ===== Cheatsheet - Docker Compose ===== | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | <file yaml compose.yaml> | ||
| + | name: myapp | ||
| + | |||
| + | services: | ||
| + |   my-service-1: | ||
| + |     # Définition de l' | ||
| + |     image: debian: | ||
| + | depends_on: | ||
| + | - my-service-2 | ||
| + | |||
| + |     environment: | ||
| + | - APP_MODE=development | ||
| + | - LOGGING=verbose | ||
| + |      | ||
| + | # Définition du réseau | ||
| + | hostname: myapp.local # Définition d'un hostname supplémentaire à ce container (son premier hostname étant my-service-1) | ||
| + |     ports:  | ||
| + |       - " | ||
| + | - name: web # Long syntax | ||
| + | target: 80 # Container port | ||
| + |         published: " | ||
| + | host-ip: 127.0.0.1 # Default: 0.0.0.0 | ||
| + | protocol: tcp # Default: tcp | ||
| + |         app_protocol: | ||
| + | mode: host # ??? | ||
| + | networks: | ||
| + |       my-network-1:  | ||
| + |       my-network-2:  | ||
| + |         aliases:  | ||
| + | - myapp # Crée un hostname supplémentaire de ce container dans ce réseau | ||
| + |         ipv4_address: | ||
| + |         ipv6_address: | ||
| + | |||
| + | # Définition des volumes / Persistence de données | ||
| + | volumes: | ||
| + |       - type: bind                 # https:// | ||
| + | # bind = Montage sur le FS host | ||
| + | # volume = Montage géré par Docker (Préféré par docker) | ||
| + | # tmpfs = Chargé en mémoire (Linux only) | ||
| + |         source: / | ||
| + |         target: / | ||
| + | read_only: true | ||
| + | bind: # Option uniquement si type = bind | ||
| + |           create_host_path: | ||
| + |         volume:  | ||
| + | nocopy: true # Ne copie pas les données du container lors de sa création | ||
| + |          | ||
| + |          | ||
| + | |||
| + | |||
| + |   my-service-2: | ||
| + | ... | ||
| + | |||
| + | networks: # Définition des réseaux | ||
| + |   my-network-1: | ||
| + |   my-network-2: | ||
| + |          | ||
| + |          | ||
| + |          | ||
| + |      | ||
| + |      | ||
| + | annotations | ||
| + | attach | ||
| + | build | ||
| + | blkio_config | ||
| + | cpu_count | ||
| + | cpu_percent | ||
| + | cpu_shares | ||
| + | cpu_period | ||
| + | cpu_quota | ||
| + | cpu_rt_runtime | ||
| + | cpu_rt_period | ||
| + | cpus | ||
| + | cpuset | ||
| + | cap_add | ||
| + | cap_drop | ||
| + | cgroup | ||
| + | cgroup_parent | ||
| + | command | ||
| + | configs | ||
| + | container_name | ||
| + | credential_spec | ||
| + | deploy | ||
| + | develop | ||
| + | device_cgroup_rules | ||
| + | devices | ||
| + | dns | ||
| + | dns_opt | ||
| + | dns_search | ||
| + | domainname | ||
| + | driver_opts | ||
| + | entrypoint | ||
| + | env_file | ||
| + | expose | ||
| + | extends | ||
| + | external_links | ||
| + | extra_hosts | ||
| + | group_add | ||
| + | healthcheck | ||
| + | init | ||
| + | ipc | ||
| + | isolation | ||
| + | labels | ||
| + | links | ||
| + | logging | ||
| + | mac_address | ||
| + | mem_limit | ||
| + | mem_reservation | ||
| + | mem_swappiness | ||
| + | memswap_limit | ||
| + | network_mode | ||
| + | oom_kill_disable | ||
| + | oom_score_adj | ||
| + | pid | ||
| + | pids_limit | ||
| + | platform | ||
| + | privileged | ||
| + | profiles | ||
| + | pull_policy | ||
| + | read_only | ||
| + | restart | ||
| + | runtime | ||
| + | scale | ||
| + | secrets | ||
| + | security_opt | ||
| + | shm_size | ||
| + | stdin_open | ||
| + | stop_grace_period | ||
| + | stop_signal | ||
| + | storage_opt | ||
| + | sysctls | ||
| + | tmpfs | ||
| + | tty | ||
| + | ulimits | ||
| + | user | ||
| + | userns_mode | ||
| + | uts | ||
| + | volumes_from | ||
| + | working_dir | ||
| + | </ | ||
article/linux/docker.1721149721.txt.gz · Dernière modification :  de Gary
                
                