Skip to content

Instantly share code, notes, and snippets.

@pichuang
Created December 20, 2019 16:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pichuang/7ce8be00c3de3f51e5c8db0689f1e08a to your computer and use it in GitHub Desktop.
Save pichuang/7ce8be00c3de3f51e5c8db0689f1e08a to your computer and use it in GitHub Desktop.
Running GitLab Container with podman and systemd
IMAGE=docker.io/gitlab/gitlab-ce:12.2.0-ce.0
HOSTNAME=gitlab.pichuang.local
NAME=gitlab-ce
[Unit]
Description=GitLab Podman container
After=network.target
[Service]
Type=simple
TimeoutStartSec=5m
Restart=always
RestartSec=30s
EnvironmentFile=/etc/sysconfig/gitlab
ExecStartPre=-/usr/bin/podman rm ${NAME}
ExecStart=/usr/bin/podman run \
--name ${NAME} \
--hostname ${HOSTNAME} \
--publish 443:443 \
--publish 80:80 \
--publish 8022:22 \
--volume /srv/gitlab/config:/etc/gitlab:Z \
--volume /srv/gitlab/logs:/var/log/gitlab:Z \
--volume /srv/gitlab/data:/var/opt/gitlab:Z \
${IMAGE}
ExecReload=-/usr/bin/podman stop ${NAME}
ExecReload=-/usr/bin/podman rm ${NAME}
ExecStop=-/usr/bin/podman stop ${NAME}
[Install]
WantedBy=multi-user.target
@mahmoudajawad
Copy link

How well is this going with you? I'm planning to give GitLab a shot and using it locally at the beginning is a great method. Do CI/CD pipelines work with GitLab running with podman?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment