Docker-compose up -d works but docker-compose -f docker-compose.plex.yml -d doesn't

I had docker set up on my last server, but due to some unfortunate keystrokes, I lost everything but the yml files. I fortunately had backed them up on another computer. After a bit of hassle, I was able to get the Plex container running correctly.

Current file name: docker-compose.plex.yml
Command: docker-compose -f docker-compose.plex.yml -d
Issue: No matter what I do, the help file for docker-compose shows up instead of running the docker.

Running on Ubuntu server 20.04.03 LTS

If I copy the file to just docker-compose.yml and issue the command docker-compose up -d, it runs just fine. The problem is that I have several container .yml files in the same directory for convenience. Do I have to copy every one of them over to the docker-compose.yml when I want to run something?

Thank you

Hello and welcome,
I guess the up is missing in the command with the docker-compose.plex.yml. :slight_smile:
For me it worked with docker-compose -f docker-compose.plex.yml up -d

I did use that command several times, I just forgot to add it in the comment here. But I did type the full command (both with and without the up).

Could you please copy and paste the exact command you used? If you got the output of help, then your parameters must be wrong. Either their name or the order of the parameters. Also check the beginning of the output above the help. Maybe it shows you what parameter was wrong.

Ok, a couple of different commands run:

docker-compose -f docker-compose.plex.yml up -d (wouldn’t work)

cp docker-compose.plex.yml docker-compose.yml

docker-compose up -d (works fine)

docker-compose -f docker-compose.plex.yml up -d (came up with help screen)

so not sure why the 2nd file fails when the straight docker-compose up -d works correctly (exact same file)

Your command should work. Could you share the help output starting with your command like:

 »  docker-compose -f docker-compose.plex.yml upa -d

Usage:  docker compose [OPTIONS] COMMAND

Docker Compose

Options:
      --ansi string                Control when to print ANSI control characters ("never"|"always"|"auto") (default "auto")
      --compatibility              Run compose in backward compatibility mode
      --env-file string            Specify an alternate environment file.
  -f, --file stringArray           Compose configuration files
      --profile stringArray        Specify a profile to enable
      --project-directory string   Specify an alternate working directory
                                   (default: the path of the Compose file)
  -p, --project-name string        Project name

Commands:
  build       Build or rebuild services
  convert     Converts the compose file to platform's canonical format
  cp          Copy files/folders between a service container and the local filesystem
  create      Creates containers for a service.
  down        Stop and remove containers, networks
  events      Receive real time events from containers.
  exec        Execute a command in a running container.
  images      List images used by the created containers
  kill        Force stop service containers.
  logs        View output from containers
  ls          List running compose projects
  pause       Pause services
  port        Print the public port for a port binding.
  ps          List containers
  pull        Pull service images
  push        Push service images
  restart     Restart containers
  rm          Removes stopped service containers
  run         Run a one-off command on a service.
  start       Start services
  stop        Stop services
  top         Display the running processes
  unpause     Unpause services
  up          Create and start containers
  version     Show the Docker Compose version information

Run 'docker compose COMMAND --help' for more information on a command.
unknown docker command: "compose upa"

Note that I intentionally made a mistake in the command to show the help. You can see the error message at the and.

That’s exactly what the command shows (just without the a on the end of your up). No errors, no comments, just straight to the help screen.

I often get similar answers from people before I tell them the small difference they did not notice. You are probably right and there is no error message or any other difference, but I still would like to see your output :slight_smile: because currently I don’t have any other idea and seeing your output can help my mind to let this possible mistake go.

Weird…now it’s working. I rebooted a couple of times prior to this and the command was still giving me that every time. After using and verifying the docker-compose up -d command, I stopped and pruned the containers, ls to verify nothing running. Rebooted twice (to make sure nothing was in memory somehow).

Verified the container was non-existent, did it again (with same results as previous)…then removed and pruned container, rebooted…now it’s working. Very strange. I did nothing different, same commands every single time.

I’m guessing maybe a glitch or something was in there somehow. I just set the server up yesterday and re-downloaded docker, so it’s not like there was any older versions out there for it. Drive was formatted prior to re-installing the server.

Ah well…it works now. Chalk it up to ghost in the machine I guess.

The first time was the command, then the help screen. Now, it builds container…done, just as if I typed the docker-compose up -d command. Everything was cut and paste, so it’s not like I was typing extra into it. The only possibility I had come up with was an extra space somewhere, so that’s why I went to the cut and paste, to eliminate that issue.

Who knows. It’s working, I’m not going to turn it down. so who knows. Ghost in the machine is my theory, I guess.