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",
|
"subvolume",
|
||||||
"swapfile",
|
"swapfile",
|
||||||
"swapon",
|
"swapon",
|
||||||
|
"syncthing",
|
||||||
"sysctls",
|
"sysctls",
|
||||||
"sysrc",
|
"sysrc",
|
||||||
"systool",
|
"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"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
syncthing:
|
syncthing:
|
||||||
image: syncthing/syncthing:1.27.8
|
image: syncthing/syncthing:2.0.12
|
||||||
container_name: syncthing
|
container_name: syncthing
|
||||||
hostname: MacBook-Pro
|
hostname: MacBook-Pro
|
||||||
environment:
|
environment:
|
||||||
- PUID=501
|
- PUID=501
|
||||||
- PGID=20
|
- PGID=20
|
||||||
|
- STGUIADDRESS=0.0.0.0:8384
|
||||||
volumes:
|
volumes:
|
||||||
- ${PWD}/config:/var/syncthing/config
|
- config:/var/syncthing/config:z
|
||||||
- ${PWD}/data:/var/syncthing/data
|
- ${PWD}/data:/var/syncthing/data
|
||||||
ports:
|
ports:
|
||||||
# No way to use 'host' mode in OS X
|
# No way to use 'host' mode in OS X
|
||||||
@@ -19,5 +20,10 @@ services:
|
|||||||
- 22000:22000/udp # QUIC file transfers
|
- 22000:22000/udp # QUIC file transfers
|
||||||
- 21027:21027/udp # Receive local discovery broadcasts
|
- 21027:21027/udp # Receive local discovery broadcasts
|
||||||
restart: unless-stopped
|
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:
|
volumes:
|
||||||
config:
|
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"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
syncthing:
|
syncthing:
|
||||||
image: syncthing/syncthing:1.27.7
|
image: syncthing/syncthing:2.0.12
|
||||||
container_name: syncthing
|
container_name: syncthing
|
||||||
hostname: ${HOSTNAME}
|
hostname: ${HOSTNAME}
|
||||||
environment:
|
environment:
|
||||||
- PUID=1000
|
- PUID=${UID-1000} # use 0 with podman
|
||||||
- PGID=100
|
- PGID=${GID-1000} # use 0 with podman
|
||||||
|
- STGUIADDRESS=0.0.0.0:8384
|
||||||
volumes:
|
volumes:
|
||||||
- config:/var/syncthing/config
|
- config:/var/syncthing/config:z
|
||||||
- ${PWD}/data:/var/syncthing/data
|
- ${PWD}/data:/var/syncthing/data
|
||||||
network_mode: host
|
network_mode: host
|
||||||
restart: unless-stopped
|
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:
|
volumes:
|
||||||
config:
|
config:
|
||||||
|
|||||||
@@ -5,23 +5,98 @@ Intended to be a drop-in replacement for [Docker].
|
|||||||
|
|
||||||
1. [TL;DR](#tldr)
|
1. [TL;DR](#tldr)
|
||||||
1. [Further readings](#further-readings)
|
1. [Further readings](#further-readings)
|
||||||
|
1. [Sources](#sources)
|
||||||
|
|
||||||
## TL;DR
|
## TL;DR
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Setup</summary>
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Install Podman.
|
# Install.
|
||||||
sudo apt install 'podman'
|
apt install 'podman' 'podman-compose'
|
||||||
sudo dnf install 'podman'
|
dnf install 'podman'
|
||||||
sudo pacman -S 'podman'
|
pacman -S 'podman'
|
||||||
sudo zypper install '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
|
## Further readings
|
||||||
|
|
||||||
- [Website]
|
- [Website]
|
||||||
|
- [Documentation]
|
||||||
- [Docker]
|
- [Docker]
|
||||||
- [Containerd]
|
- [Containerd]
|
||||||
- [Kaniko]
|
- [Kaniko]
|
||||||
|
- [Volumes and rootless Podman]
|
||||||
|
|
||||||
|
### Sources
|
||||||
|
|
||||||
|
- [Pull Official Images From Docker Hub Using Podman]
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Reference
|
Reference
|
||||||
@@ -34,4 +109,9 @@ sudo zypper install 'podman'
|
|||||||
[kaniko]: kaniko.md
|
[kaniko]: kaniko.md
|
||||||
|
|
||||||
<!-- Upstream -->
|
<!-- 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