konstruktoid / ansible-role-docker-rootless

Ansible role to install a rootless Docker server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use 'docker compose' command (without hiphen)

naub1n opened this issue · comments

Hi,

Docker compose installation is not the same as Official docker compose installation.

docker compose command don't work.

docker: 'compose' is not a docker command.
See 'docker --help'

But 'docker-compose' command work well.

I add a task to create docker plugins directory and I change the destination path when downloading docker-compose:

- name: Create docker plugins directory
  file:
    path: "{{ docker_user_info.home }}/.docker/cli-plugins"
    state: directory
    owner: "{{ docker_user }}"
    group: "{{ docker_user }}"

- name: Download docker-compose
  become: true
  become_user: "{{ docker_user }}"
  ansible.builtin.get_url:
    url: "https://github.com/docker/compose/releases/download/v{{ docker_compose_release }}/docker-compose-linux-x86_64"
    dest: "{{ docker_user_info.home }}/.docker/cli-plugins/docker-compose"
    checksum: sha256:{{ docker_compose_release_shasum }}
    owner: "{{ docker_user }}"
    mode: "0755"
  when: docker_compose
  tags:
    - docker-compose

Now I can use docker compose command.

Hi @naub1nnicce catch, I'll update.
But a quick check: are you installing using docker_rootful: false (https://github.com/konstruktoid/ansible-role-docker-rootless/blob/main/defaults/main.yml#L12) and is {{ docker_user_info.home }}/bin/docker-compose present?

Hi @naub1nnicce catch, I'll update. But a quick check: are you installing using docker_rootful: false (https://github.com/konstruktoid/ansible-role-docker-rootless/blob/main/defaults/main.yml#L12) and is {{ docker_user_info.home }}/bin/docker-compose present?

Yes, I only use:

docker_user: XXXXX
docker_user_bashrc: true
docker_allow_privileged_ports: true
docker_compose: true

is {{ docker_user_info.home }}/bin/docker-compose present?

Yes, because I don't erase VM. I will try with fresh install

A PR will soon be available

I edit my answer with your second question :)

is {{ docker_user_info.home }}/bin/docker-compose present?

Yes, because I don't erase VM. I will try with fresh install

yeah, i'll add so it's removed and replaced by a link pointing to /.docker/cli-plugins

After fresh install, {{ docker_user_info.home }}/bin/docker-compose is not present.

what docker version do you have?

what docker version do you have?

Docker version 24.0.5, build ced0996

Sorry for the long delay, can you test #205?

Sorry for the long delay, can you test #205?

No problem! ;) I test it on fresh install.
Everything work fine !!