Skip to content

Instantly share code, notes, and snippets.

@ynwd
Created June 24, 2022 08:56
Show Gist options
  • Save ynwd/53fcebb1f738abaf73301d6112491081 to your computer and use it in GitHub Desktop.
Save ynwd/53fcebb1f738abaf73301d6112491081 to your computer and use it in GitHub Desktop.
How to run docker-compose on podman and macos

podman

Install podman and docker-compose

> brew install podman
> brew install docker-compose

Create a symlink so podman can be executed with "docker" command.

> ln -s /usr/local/bin/podman /usr/local/bin/docker

Podman init & start

> podman machine init
> podman machine start
> Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users/pro:/Users/pro

This machine is currently configured in rootless mode. If your containers
require root permissions (e.g. ports < 1024), or if you run into compatibility
issues with non-podman clients, you can switch using the following command: 

	podman machine set --rootful

API forwarding listening on: /Users/pro/.local/share/containers/podman/machine/podman-machine-default/podman.sock

The system helper service is not installed; the default Docker API socket
address can't be used by podman. If you would like to install it run the
following commands:

	sudo /usr/local/Cellar/podman/4.1.1/bin/podman-mac-helper install
	podman machine stop; podman machine start

You can still connect Docker API clients by setting DOCKER_HOST using the
following command in your terminal session:

	export DOCKER_HOST='unix:///Users/pro/.local/share/containers/podman/machine/podman-machine-default/podman.sock'

Machine "podman-machine-default" started successfully

Run docker-compose as usual

> docker-compose up
[+] Running 1/5
 ⠿ db Pulled                                                             120.7s
   ⠼ 43ae61f09c89 Download complete                                      118.3s
   ⠸ 75cb53669883 Download complete                                      118.3s
   ⠸ 1c9ae6eaa19c Download complete                                      118.3s
   ⠙ 9ab26f8e5685 Download complete                                        0.1s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment