Projekt

Allgemein

Profil

Podman » Historie » Version 4

Jeremias Keihsler, 23.09.2021 12:54

1 1 Jeremias Keihsler
h1. Podman
2
3
h2. install
4
5
<pre><code class="shell">
6
yum install podman
7
yum install podman-compose
8
</code></pre>
9
10
h2. create container
11
12
see also:
13
https://www.redhat.com/sysadmin/wordpress-container
14
https://rancher.com/learning-paths/how-to-build-and-run-your-own-container-images/
15
https://docs.podman.io/en/latest/markdown/podman-build.1.html
16
17 2 Jeremias Keihsler
create @~/container.user/wordpress.user/Dockerfile@
18 1 Jeremias Keihsler
19
<pre>
20
FROM docker.io/rockylinux/rockylinux
21
MAINTAINER jke &lt;j@keihsler.com&gt;
22
RUN dnf module enable -y php:7.4
23
RUN yum install -y mariadb-server mariadb php php-apcu php-intl php-mbstring php-xml php-json php-mysqlnd crontabs cronie iputils net-tools;yum clean all
24
RUN systemctl enable mariadb
25
RUN systemctl enable httpd
26
RUN systemctl disable systemd-update-utmp.service
27
ENTRYPOINT ["/sbin/init"]
28
CMD ["/sbin/init"]
29
</pre>
30
31
<pre><code class="shell">
32
cd ~/container.user/wordpress.user/
33
podman build -t wordpress_user .
34
</code></pre>
35 3 Jeremias Keihsler
36
37
h2. compose pod
38
39
create @~/compose.user/nextcloud.user/compose.yml@
40
41
<pre><code class="yaml">
42
version: '3'
43
44
services:
45
46
  db:
47
    image: mariadb
48
    container_name: nextcloud-mariadb
49
    networks:
50
      - nextcloud_network
51
    volumes:
52
      - db:/opt/nextcloud/mysql
53
      - /etc/localtime:/etc/localtime:ro
54
    environment:
55
      - MYSQL_ROOT_PASSWORD=XXXXX
56
      - MYSQL_PASSWORD=XXXXX
57
      - MYSQL_DATABASE=nextcloud
58
      - MYSQL_USER=nextcloud
59
    restart: unless-stopped
60
61
  app:
62
    image: nextcloud:latest
63
    container_name: nextcloud-app
64
    ports:
65
      - 9099:80
66
    networks:
67
      - nextcloud_network
68
    depends_on:
69
      - db
70
    volumes:
71
      - nextcloud:/var/www/html
72
      - ./app/config:/var/www/html/config
73
      - ./app/custom_apps:/var/www/html/custom_apps
74
      - ./app/data:/var/www/html/data
75
      - ./app/themes:/opt/nextcloud/www/html/themes
76
      - /etc/localtime:/etc/localtime:ro
77
    environment:
78
      - VIRTUAL_HOST=ak-i40-cloud.openfab.org
79
    restart: unless-stopped
80
81
volumes:
82
  nextcloud:
83
  db:
84
85
networks:
86
  nextcloud_network:
87
</code></pre>
88 4 Jeremias Keihsler
89
<pre><code class="shell">
90
podman-compose -f ~/compose.user/nextcloud.user/compose.yml up
91
</code></pre>