Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running on ARM64 M1 Pro #229

Closed
TheRubble opened this issue Nov 14, 2021 · 3 comments
Closed

Running on ARM64 M1 Pro #229

TheRubble opened this issue Nov 14, 2021 · 3 comments
Labels
help wanted waiting-for-feedback Waiting for someone to give feedback until this issue can be brought further.

Comments

@TheRubble
Copy link

Running the following :

 var builder = new Builder()
                .UseContainer()
                .UseCompose()
                .FromFile(file)
                .RemoveOrphans()
                .WaitForHttp("eventstore", "http://localhost:2113", timeout: 60000)
                .Build();

Results in :

Could not create composite service with file(s) /Users/xxx/Git/Phoenix/Rota.Api.IntegrationTests/bin/Debug/net6.0/../../../../docker-compose.yml - result: 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

Same code works fine on windows and on mac, I think it's something to do with a slight difference in the ARM64 M1 implementation, happy to look into it at some point. However thought I'd ask the question on the off chance that someone else has seen this.

@TheRubble
Copy link
Author

TheRubble commented Nov 15, 2021

Done some digging and it looks like this is the problem.

CommandExtensions.cs

internal static string RenderBaseArgs(this Uri host, ICertificatePaths certificates = null)
    {
      var args = string.Empty;
      if (null != host)
      {
        args = $" -H {host}";
      }

      if (null == certificates)
        return args;

      args +=
        $" --tlsverify --tlscacert={certificates.CaCertificate} --tlscert={certificates.ClientCertificate} --tlskey={certificates.ClientKey}";

      return args;
    }

A simple fix appears to be a runtimeinfo check to see if it's running on ARM as the "-H" argument isn't available.

@mariotoffia
Copy link
Owner

Hi @TheRubble - hmmm... missing -H is a biggie... how to you point to another docker daemon when you don't have the -H switch on a M1?

Cheers,
Mario

@mariotoffia mariotoffia added answer The question/bug has been answered/workaround help wanted waiting-for-feedback Waiting for someone to give feedback until this issue can be brought further. and removed answer The question/bug has been answered/workaround labels Nov 25, 2021
@mariotoffia
Copy link
Owner

Hi @TheRubble - The new version does fix this as long as you connect to your default docker daemon. Checkout PR #238.

Cheers,
Mario :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted waiting-for-feedback Waiting for someone to give feedback until this issue can be brought further.
Projects
None yet
Development

No branches or pull requests

2 participants