diff options
Diffstat (limited to 'docs/tutorials')
-rw-r--r-- | docs/tutorials/mac_experimental.md | 99 | ||||
-rw-r--r-- | docs/tutorials/podman-go-bindings.md | 12 | ||||
-rw-r--r-- | docs/tutorials/remote_client.md | 4 |
3 files changed, 109 insertions, 6 deletions
diff --git a/docs/tutorials/mac_experimental.md b/docs/tutorials/mac_experimental.md new file mode 100644 index 000000000..8df64dc99 --- /dev/null +++ b/docs/tutorials/mac_experimental.md @@ -0,0 +1,99 @@ +# Using podman-machine on MacOS (x86_64 and Apple silicon) + +## Setup + +You must obtain a compressed tarball that contains the following: +* a qcow image +* a podman binary +* a gvproxy binary + +You must also have installed brew prior to following this process. See https://brew.sh/ for +installation instructions. + +Note: If your user has admin rights, you can ignore the use of `sudo` in these instructions. + + +1. Install qemu from brew to obtain the required runtime dependencies. + + ``` + brew install qemu + ``` + +2. If you are running MacOS on the Intel architecture, you can skip to step 8. +3. Uninstall the brew package + + ``` + brew uninstall qemu + ``` + +4. Get upstream qemu source code. + + ``` + git clone https://github.com/qemu/qemu + ``` + +5. Apply patches that have not been merged into upstream qemu. + + ``` + cd qemu + git config user.name "YOUR_NAME" + git config user.email johndoe@example.com + git checkout v5.2.0 + curl https://patchwork.kernel.org/series/418581/mbox/ | git am --exclude=MAINTAINERS + curl -L https://gist.github.com/citruz/9896cd6fb63288ac95f81716756cb9aa/raw/2d613e9a003b28dfe688f33055706d3873025a40/xcode-12-4.patch | git apply - + ``` + +6. Install qemu build dependencies + + ``` + brew install libffi gettext pkg-config autoconf automake pixman ninja make + ``` + +7. Configure, compile, and install qemu + ``` + mkdir build + cd build + ../configure --target-list=aarch64-softmmu --disable-gnutls + gmake -j8 + sudo gmake install + ``` + + +8. Uncompress and place provided binaries into filesystem + + **Note**: In the following instructions, you need to know the name of the compressed file +that you were given. It will be used in two of the steps below. + + ``` + cd ~ + tar xvf `compressed_file_ending_in_xz` + sudo cp -v `unpacked_directory`/{gvproxy,podman} /usr/local/bin + ``` + +9. Sign all binaries + + If you have a Mac with Apple Silicon, issue the following command: + ``` + sudo codesign --entitlements ~/qemu/accel/hvf/entitlements.plist --force -s - /usr/local/bin/qemu-* /usr/local/bin/gvproxy /usr/local/bin/podman + ``` + + If you have a Mac with an Intel processor, issue the following command: + + ``` + echo '<?xml version="1.0" encoding="utf-8"?> + <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> + <plist version="1.0"> <dict> <key>com.apple.security.hypervisor</key> <true/> </dict> </plist> + ' > ~/entitlements.plist + sudo codesign --entitlements ~/entitlements.plist --force -s - /usr/local/bin/qemu-* /usr/local/bin/gvproxy /usr/local/bin/podman + ``` + + +## Test podman + +1. podman machine init --image-path /path/to/image +2. podman machine start +3. podman images +4. git clone http://github.com/baude/alpine_nginx && cd alpine_nginx +5. podman build -t alpine_nginx . +4. podman run -dt -p 9999:80 alpine_nginx +5. curl http://localhost:9999 diff --git a/docs/tutorials/podman-go-bindings.md b/docs/tutorials/podman-go-bindings.md index a952f2dc0..2bbf4e5de 100644 --- a/docs/tutorials/podman-go-bindings.md +++ b/docs/tutorials/podman-go-bindings.md @@ -174,7 +174,7 @@ This binding takes three arguments: ```Go // Pull Busybox image (Sample 1) fmt.Println("Pulling Busybox image...") - _, err = images.Pull(connText, "docker.io/busybox", entities.ImagePullOptions{}) + _, err = images.Pull(connText, "docker.io/busybox", &images.PullOptions{}) if err != nil { fmt.Println(err) os.Exit(1) @@ -183,7 +183,7 @@ This binding takes three arguments: // Pull Fedora image (Sample 2) rawImage := "registry.fedoraproject.org/fedora:latest" fmt.Println("Pulling Fedora image...") - _, err = images.Pull(connText, rawImage, entities.ImagePullOptions{}) + _, err = images.Pull(connText, rawImage, &images.PullOptions{}) if err != nil { fmt.Println(err) os.Exit(1) @@ -229,7 +229,7 @@ This binding takes three arguments: ```Go // List images - imageSummary, err := images.List(connText, nil, nil) + imageSummary, err := images.List(connText, &images.ListOptions{}) if err != nil { fmt.Println(err) os.Exit(1) @@ -287,7 +287,7 @@ containers.Wait() takes three arguments: // Container create s := specgen.NewSpecGenerator(rawImage, false) s.Terminal = true - r, err := containers.CreateWithSpec(connText, s) + r, err := containers.CreateWithSpec(connText, s, nil) if err != nil { fmt.Println(err) os.Exit(1) @@ -302,7 +302,7 @@ containers.Wait() takes three arguments: } running := define.ContainerStateRunning - _, err = containers.Wait(connText, r.ID, &running) + _, err = containers.Wait(connText, r.ID, &containers.WaitOptions{Condition: []define.ContainerStatus{running}}) if err != nil { fmt.Println(err) os.Exit(1) @@ -346,7 +346,7 @@ containers.List() takes seven arguments: ```Go // Container list var latestContainers = 1 - containerLatestList, err := containers.List(connText, nil, nil, &latestContainers, nil, nil, nil) + containerLatestList, err := containers.List(connText, &containers.ListOptions{Last: &latestContainers}) if err != nil { fmt.Println(err) os.Exit(1) diff --git a/docs/tutorials/remote_client.md b/docs/tutorials/remote_client.md index e39d804a6..889947397 100644 --- a/docs/tutorials/remote_client.md +++ b/docs/tutorials/remote_client.md @@ -108,5 +108,9 @@ podman-remote system connection --help You can use the Podman remote clients to manage your containers running on a Linux server. The communication between client and server relies heavily on SSH connections and the use of SSH keys are encouraged. Once you have Podman installed on your remote client, you should set up a connection using `podman-remote system connection add` which will then be used by subsequent Podman commands. +# Troubleshooting + +See the [Troubleshooting](../../troubleshooting.md) document if you run into issues. + ## History Adapted from the [Mac and Windows tutorial](https://github.com/containers/podman/blob/master/docs/tutorials/mac_win_client.md) |