Skip to content

Instantly share code, notes, and snippets.

@afrittoli
Last active June 21, 2023 19:23
Show Gist options
  • Save afrittoli/285d7de60fe84eaf6a879c6ced203d23 to your computer and use it in GitHub Desktop.
Save afrittoli/285d7de60fe84eaf6a879c6ced203d23 to your computer and use it in GitHub Desktop.
Harbor dev env on MacOS M1 with Podman

Harbor dev env on MacOS M1 with Podman

Prereq: podman is installed

  1. Install podman-compose
pip3 install podman-compose
  1. Start the podman machine with your go/clone path mounted. I clone golang github repos under /go/src/github.com/:
podman machine init --cpus 4 --disk-size 100 --memory 8192 --rootful -v $HOME:$HOME -v /go/:/go
podman machine start
  1. Follow instruction for this blog post for local config setup:
  • copy template config file
  • set hostname
  • set local ports
  • generate and config certificates
  • Additionally, set the data dir to a folder available in the podman machine, mounted from the home, like for instance /Users/<$USER>/harbor-data (replace user with the value on your machine) and create the local folder:
    mkdir ~/harbor-data
  1. Generate the install script
make install COMPILETAG=compile_golangimage
  1. Add the following three lines at the top of the make/install and scripts:
shopt -s expand_aliases
alias docker='podman'
alias docker-compose='podman-compose'
  1. Build the prepare base image and image
podman build . --arch arm64 -f make/photon/prepare/Dockerfile.base -t local/harbor-prepare-base:dev
podman build . --arch arm64 -f make/photon/prepare/Dockerfile --build-arg harbor_base_image_version=dev --build-arg harbor_base_namespace=local -t goharbor/prepare:dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment