Alt linux docker compose install

Docker

Для запуска docker от пользователя (не root) следует выполнить несколько шагов:

  1. Добавить пользователя в группу docker ; # usermod ИМЯ_ПОЛЬЗОВАТЕЛЯ -aG docker
  2. Выполнить повторный вход в систему.

Затем необходимо запустить соответствующую службу:

# systemctl enable —now docker

Запуск и готовые образы

В зависимости от действий на этапе установки команды можно будет запускать от обычного пользователя или от root .

Официальный образ

Официальный образ ALT — это registry.altlinux.org/alt/alt , также его можно получить по ссылке: https://hub.docker.com/_/alt/. Для запуска контейнера достаточно выполнить следующую команду:

По умолчанию используется образ из тега latest , который указывает на последний стабильный бранч. Например, сейчас это p10.

Для использования образа sisyphus нужно указать соответствующий тег:

docker run —rm -it alt:sisyphus

Официальный образ доступен для следующих архитектур:

Производные образы

По адресу https://registry.altlinux.org/organization/alt находятся специализированные образы под конкретные задачи, построенные на основе официального образа. Сборка этих образов осуществляется из шаблонов Dockerfile’ов по адресу https://github.com/alt-cloud/image-forge/tree/master/org/alt.

Существуют образы для следующих задач:

  • веб серверы unit , nginx и apache2 ;
  • хранение конфигурации etcd ;
  • интерпретаторы для запуска своих приложений python и ruby ;
  • и другие.

Сборка базового образа с использование mkimage-profiles

Rootfs для официального образа собирается из профиля ve/docker. Собрать его можно следующей командой.

Полученный rootfs нужно собрать, чтобы получить образ. Для этого нужно создать каталог, скопировать в него rootfs и создать Dockerfile со следующим содержимым:

FROM scratch ADD docker-latest.tar.xz / RUN true > /etc/security/limits.d/50-defaults.conf # overwrite this with 'CMD []' in a dependent Dockerfile CMD ["/bin/bash"]

Затем можно собрать образ:

$ docker build --rm --tag=my-image .

Где my-image — это имя образа.

Читайте также:  Континент ап linux debian

Rootless

Для запуска docker демона от пользователя можно использовать пакет docker-engine-rootless. Установить его можно следующей командой:

# apt-get install docker-engine-rootless

Далее нужно настроить запуск демона от пользователя:

И экcпортировать переменную DOCKER_HOST:

Последнюю строку можно добавить, в файл из которого шелл инициализирует переменные, например, в ~/.bash_profile, если используется bash.

Источник

Install the Compose plugin

Important

From July 2023 Compose V1 stopped receiving updates. It’s also no longer available in new releases of Docker Desktop.

Compose V2 is included with all currently supported versions of Docker Desktop. For more information, see Migrate to Compose V2.

Docker’s documentation refers to and describes Compose V2 functionality.

On this page you can find instructions on how to install the Compose plugin on Linux from the command line.

To install the Compose plugin on Linux, you can either:

Note

These instructions assume you already have Docker Engine and Docker CLI installed and now want to install the Compose plugin.
For Compose standalone, see Install Compose Standalone.

Install using the repository

  1. Set up the repository. Find distro-specific instructions in: Ubuntu | CentOS | Debian | Fedora | RHEL | SLES.
  2. Update the package index, and install the latest version of Docker Compose:
  3. For Ubuntu and Debian, run:
 $ sudo apt-get update $ sudo apt-get install docker-compose-plugin 
 $ sudo yum update $ sudo yum install docker-compose-plugin 
$ docker compose version Docker Compose version vN.N.N 

Where vN.N.N is placeholder text standing in for the latest version.

Update Compose

To update the Compose plugin, run the following commands:

    For Ubuntu and Debian, run:

 $ sudo apt-get update $ sudo apt-get install docker-compose-plugin 
 $ sudo yum update $ sudo yum install docker-compose-plugin 

Install the plugin manually

Note

This option requires you to manage upgrades manually. We recommend setting up Docker’s repository for easier maintenance.

$ DOCKER_CONFIG=$DOCKER_CONFIG:-$HOME/.docker> $ mkdir -p $DOCKER_CONFIG/cli-plugins $ curl -SL https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose 
  • Docker Compose for all users on your system, replace ~/.docker/cli-plugins with /usr/local/lib/docker/cli-plugins .
  • A different version of Compose, substitute v2.20.0 with the version of Compose you want to use.
  • For a different architecture, substitute x86_64 with the architecture you want.
 $ chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose 
 $ sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose 
 $ docker compose version Docker Compose version v2.20.0 

Источник

Install Compose standalone

Important

From July 2023 Compose V1 stopped receiving updates. It’s also no longer available in new releases of Docker Desktop.

Compose V2 is included with all currently supported versions of Docker Desktop. For more information, see Migrate to Compose V2.

Docker’s documentation refers to and describes Compose V2 functionality.

On this page you can find instructions on how to install Compose standalone on Linux or Windows Server, from the command line.

On Linux

Compose standalone

Note that Compose standalone uses the -compose syntax instead of the current standard syntax compose .
For example type docker-compose up when using Compose standalone, instead of docker compose up .

 $ curl -SL https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose 

Note

If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path. For example:

$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose 

On Windows Server

Follow these instructions if you are running the Docker daemon and client directly on Microsoft Windows Server and want to install Docker Compose.

  1. Run PowerShell as an administrator. When asked if you want to allow this app to make changes to your device, click Yes in order to proceed with the installation.
  2. GitHub now requires TLS1.2. In PowerShell, run the following:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
 Start-BitsTransfer -Source "https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-windows-x86_64.exe" -Destination $Env:ProgramFiles\Docker\docker-compose.exe 

Note On Windows Server 2019 you can add the Compose executable to $Env:ProgramFiles\Docker . Because this directory is registered in the system PATH , you can run the docker-compose —version command on the subsequent step with no additional configuration.

To install a different version of Compose, substitute v2.20.0 with the version of Compose you want to use.

$ docker-compose.exe version Docker Compose version v2.20.0 

Источник

Оцените статью
Adblock
detector