- Operating System: Debian GNU/Linux 12 (bookworm)
- Kernel: Linux 6.1.64-09049-g010fe86d9eae
- Architecture: x86-64
- Podman: v1.7.1
1. Install Podman:
sudo apt install podman2. Verify installation:
$ podman --version
podman version 4.3.13. Install Podman Desktop:
- Download the .tar.gz archive from https://podman-desktop.io/downloads (actual download URL at the moment of writing this guide: https://github.com/containers/podman-desktop/releases/download/v1.7.1/podman-desktop-1.7.1.tar.gz)
- Extract the archive:
sudo tar xvf podman-desktop-1.7.1.tar.gz --directory=/opt 4. Create desktop shortcut for ChromeOS: [1]
- Create the applications directory if it not exists yet:
mkdir ~/.local/share/applications - Create
Podman.desktopfile usingnvim(sudo apt install neovim):
nvim ~/.local/share/applications/Podman.desktop- Paste the following content (adjust icon path if needed):
[Desktop Entry]
Name=Podman Desktop
Exec=/opt/podman-desktop-1.7.1/podman-desktop %u
Terminal=false
Type=Application
Icon=/home/<put-your-username-here>/Images/podman.png - If there is no icon, download a custom one. I am using this: https://www.justinleegrant.com/assets/img/2021/podman.png
- Wait a few seconds or reboot Crostini/ChromeOS and icon should appear in the app launcher
5. Test Installation
- Create a PostgreSQL container:
podman run -p 5432:5432 --name <your-container-name> -e POSTGRES_PASSWORD=postgres -d docker.io/postgres- Open Podman Desktop and you will see your container (restart the app if there are no info)
Error: cannot find UID/GID for user [2]:
- In Chrome, open crosh shell (Ctrl + Alt + T)
$ vsh termina
$ lxc exec penguin -- /bin/sh -c "printf '%s\n' '1000:100000:65536' | tee /etc/subuid /etc/subgid"Error: potentially insufficient UIDs or GIDs [3]:
podman system migrate$ podman pull docker.io/rust:laterNote: for our simple dev run we only want to test lib unit tests. Add --bin to add binaries unit tests. Or just use test to run lib unit tests, binaries unit tests, doc tests, and integration tests.
FROM rust:latest
# Install any additional dependencies your project might need
RUN apt-get update && apt-get install -y build-essential
WORKDIR /app
# Copy your project files
# Except we don't anymore, we use -v .:/app to mount it instead so we get changes
#COPY . .
# Build your Rust project (optional, can be done later)
# RUN cargo test
# Except we don't anymore, because RUN executes the command on image build
# Instead we use ENTRYPOINT, which executes the command on image start
ENTRYPOINT cargo test --bins
!#/bin/bash
podman build -t my-advent-of-code:latest .
Note: we don't want to create target in our source dir, so instead of mounting . in /app we mount Cargo.lock, Cargo.toml, and src.
!#/bin/bash
podman run -v ./Cargo.lock:/app/Cargo.lock -v ./Cargo.toml:/app/Cargo.toml -v ./src:/app/src my-advent-of-code:latest
Change the name in the scripts from advent-of-code to your choice.
$ cargo init advent-of-code
$ cd advent-of-code
$ cp ../Containerfile .
$ cp ../build-it .
$ cp ../run-it .
$ ./build-it
$ ./run-it