Docker-compose creation error

Hello!

  1. docker-compose installed on the host machine via rpm-ostree gives an error at startup
    Status: Downloaded newer image for docker.io/adminer:latest
    Creating _adminer1_1 … error

ERROR: for _adminer1_1 Cannot create container for service adminer1: Invalid container name (adminer1_1), only [a-zA-Z0-9][a-zA-Z0-9.-] are allowed

ERROR: for adminer1 Cannot create container for service adminer1: Invalid container name (adminer1_1), only [a-zA-Z0-9][a-zA-Z0-9.-] are allowed
ERROR: Encountered errors while bringing up the project.
compose file:
version: ‘3.1’

services:

adminer:
image: adminer
restart: always
ports:
- 8080:8080

db:
image: mysql:5.6
restart: always
environment:
MYSQL_ROOT_PASSWORD: example

  1. how to run docker and other services through the toolbox?
    System has not been booted with systemd as init system (PID 1). Can’t operate.
    Failed to connect to bus: Host is down

I really like silver blue, but everything is familiar at the workstation

I’m using docker-compose on Silverblue, we’ll try to found a solution to your problem.

My installation, moby-engine and docker-compose are installed with rpm-ostree.
You can run docker-compose directly on host, but I don’t feel it useful, I prefer running it inside toolbox, for that you need to prefix docker-compose with the command “flatpak-spawn --host” ( my alias: dkc='flatpak-spawn --host docker-compose" and dk=“flatpak-spawn --host docker”)

You’ll also have problems with volumes, you need to uses named volumes ( I don’t yet found a solution with host volume )

Thank you for responding to the problem

⬢[local@toolbox Documents]$ flatpak-spawn --host docker-compose -f adminer.yml up -d
ERROR: Couldn’t connect to Docker daemon at http+docker://localhost - is it running?
⬢[root@toolbox Documents]# flatpak-spawn --host docker-compose -f adminer.yml up -d
Can’t find bus: Error sending credentials: Error sending message: Broken pipe

If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

docker on the machine running

could you confirm you’ve installed docker with the moby-engine package with “rpm-ostree install” command ?
if yes, it’s surely because docker isn’t started, try to do a “systemctl start docker”
If you use everyday docker, I recommend to start it automatically with “systemctl enable docker”

yes the moby-engine package is installed “install rpm-ostree”
Run at the root
systemctl launches docker
flatpak-spawn --host runs only in toolbox
⬢[root@toolbox Documents]# flatpak-spawn --host docker-compose
Can’t find bus: Error receiving data: Connection reset by peer
⬢[root@toolbox Documents]# flatpak-spawn --host docker-compose up -d
Can’t find bus: Error sending credentials: Error sending message: Broken pipe
⬢[root@toolbox Documents]# exit
exit
⬢[guzhavin@toolbox Documents]$ flatpak-spawn --host docker-compose up -d
ERROR: Couldn’t connect to Docker daemon at http+docker://localhost - is it running?

If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

I think the problem with access rights?

I’m not sure it’s possible to uses daemon mode with docker-compose, for testing, uses only the non-daemon mode (without the -d argument).

After you’ve installed moby-engine + docker-compose, on host with rpm-ostree, you need to reboot.
Then, check if the « systemct enabled docker » was correctly understood with: « systemctl status docker »

Found what was the error
in the directory structure.
I ran docker-compose from my home directory with relative ~ /home paths.
Created a directory inside /var all ok

1 Like