mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(podman): run syncthing
This commit is contained in:
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@@ -334,6 +334,7 @@
|
||||
"subvolume",
|
||||
"swapfile",
|
||||
"swapon",
|
||||
"syncthing",
|
||||
"sysctls",
|
||||
"sysrc",
|
||||
"systool",
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
# See https://github.com/syncthing/syncthing/blob/main/README-Docker.md
|
||||
# Refer https://github.com/syncthing/syncthing/blob/main/README-Docker.md
|
||||
version: "3"
|
||||
services:
|
||||
syncthing:
|
||||
image: syncthing/syncthing:1.27.8
|
||||
image: syncthing/syncthing:2.0.12
|
||||
container_name: syncthing
|
||||
hostname: MacBook-Pro
|
||||
environment:
|
||||
- PUID=501
|
||||
- PGID=20
|
||||
- STGUIADDRESS=0.0.0.0:8384
|
||||
volumes:
|
||||
- ${PWD}/config:/var/syncthing/config
|
||||
- config:/var/syncthing/config:z
|
||||
- ${PWD}/data:/var/syncthing/data
|
||||
ports:
|
||||
# No way to use 'host' mode in OS X
|
||||
@@ -19,5 +20,10 @@ services:
|
||||
- 22000:22000/udp # QUIC file transfers
|
||||
- 21027:21027/udp # Receive local discovery broadcasts
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never OK || exit 1
|
||||
interval: 1m
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
volumes:
|
||||
config:
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
---
|
||||
# See https://github.com/syncthing/syncthing/blob/main/README-Docker.md
|
||||
# Refer https://github.com/syncthing/syncthing/blob/main/README-Docker.md
|
||||
version: "3"
|
||||
services:
|
||||
syncthing:
|
||||
image: syncthing/syncthing:1.27.7
|
||||
image: syncthing/syncthing:2.0.12
|
||||
container_name: syncthing
|
||||
hostname: ${HOSTNAME}
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=100
|
||||
- PUID=${UID-1000} # use 0 with podman
|
||||
- PGID=${GID-1000} # use 0 with podman
|
||||
- STGUIADDRESS=0.0.0.0:8384
|
||||
volumes:
|
||||
- config:/var/syncthing/config
|
||||
- config:/var/syncthing/config:z
|
||||
- ${PWD}/data:/var/syncthing/data
|
||||
network_mode: host
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never OK || exit 1
|
||||
interval: 1m
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
volumes:
|
||||
config:
|
||||
|
||||
@@ -5,23 +5,98 @@ Intended to be a drop-in replacement for [Docker].
|
||||
|
||||
1. [TL;DR](#tldr)
|
||||
1. [Further readings](#further-readings)
|
||||
1. [Sources](#sources)
|
||||
|
||||
## TL;DR
|
||||
|
||||
<details>
|
||||
<summary>Setup</summary>
|
||||
|
||||
```sh
|
||||
# Install Podman.
|
||||
sudo apt install 'podman'
|
||||
sudo dnf install 'podman'
|
||||
sudo pacman -S 'podman'
|
||||
sudo zypper install 'podman'
|
||||
# Install.
|
||||
apt install 'podman' 'podman-compose'
|
||||
dnf install 'podman'
|
||||
pacman -S 'podman'
|
||||
zypper install 'podman'
|
||||
|
||||
# Add container registries to use.
|
||||
echo 'unqualified-search-registries = ["docker.io"]' > "$HOME/.config/containers/registries.conf"
|
||||
echo 'unqualified-search-registries = ["docker.io"]' | tee -a '/etc/containers/registries.conf.d/docker.io'
|
||||
|
||||
# Set aliases for container registries.
|
||||
cat <<EOF | tee '/etc/containers/registries.conf.d/shortnames.conf'
|
||||
[aliases]
|
||||
"orclinx" = "container-registry.oracle.com/os/oraclelinux"
|
||||
EOF
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Usage</summary>
|
||||
|
||||
```sh
|
||||
# Get the version.
|
||||
podman --version
|
||||
|
||||
# Get help.
|
||||
man podman
|
||||
man 'containers-registries.conf'
|
||||
|
||||
# List local images.
|
||||
podman image list
|
||||
podman images
|
||||
|
||||
# Search for images.
|
||||
podman search 'fedora'
|
||||
podman search --format "{{.Name}}\t{{.Stars}}\t{{.Official}}" --limit 3 'alpine'
|
||||
podman search --list-tags 'registry.access.redhat.com/ubi8' --limit 4
|
||||
|
||||
# Pull images.
|
||||
podman pull 'docker.io/library/postgres'
|
||||
podman pull 'docker.io/library/python:3.10'
|
||||
podman-compose pull
|
||||
|
||||
# List volumes.
|
||||
podman volume ls
|
||||
podman volume list
|
||||
|
||||
# Get a shell in containers.
|
||||
podman run --rm --name 'syncthing' --tty --interactive --entrypoint 'sh' 'syncthing/syncthing'
|
||||
podman-compose run --rm --entrypoint 'sh' 'syncthing'
|
||||
|
||||
# Check running containers.
|
||||
podman ps
|
||||
podman ps --all
|
||||
|
||||
# Manage compositions.
|
||||
podman-compose up
|
||||
podman-compose up --detach
|
||||
podman-compose ps
|
||||
podman-compose down
|
||||
|
||||
# Execute commands in containers.
|
||||
podman-compose exec 'syncthing' whoami
|
||||
|
||||
# Clean up.
|
||||
podman system prune
|
||||
podman system prune --all
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## Further readings
|
||||
|
||||
- [Website]
|
||||
- [Documentation]
|
||||
- [Docker]
|
||||
- [Containerd]
|
||||
- [Kaniko]
|
||||
- [Volumes and rootless Podman]
|
||||
|
||||
### Sources
|
||||
|
||||
- [Pull Official Images From Docker Hub Using Podman]
|
||||
|
||||
<!--
|
||||
Reference
|
||||
@@ -34,4 +109,9 @@ sudo zypper install 'podman'
|
||||
[kaniko]: kaniko.md
|
||||
|
||||
<!-- Upstream -->
|
||||
[website]: https://podman.io/
|
||||
[Documentation]: https://docs.podman.io/en/stable/
|
||||
[Website]: https://podman.io/
|
||||
|
||||
<!-- Others -->
|
||||
[Pull Official Images From Docker Hub Using Podman]: https://www.baeldung.com/ops/podman-pull-image-docker-hub
|
||||
[Volumes and rootless Podman]: https://blog.christophersmart.com/2021/01/31/volumes-and-rootless-podman/
|
||||
|
||||
Reference in New Issue
Block a user