Skip to content

Instantly share code, notes, and snippets.

@goncalossilva
Last active June 18, 2023 23:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goncalossilva/677967e0eae426c755da13c0fefa9362 to your computer and use it in GitHub Desktop.
Save goncalossilva/677967e0eae426c755da13c0fefa9362 to your computer and use it in GitHub Desktop.
Butane file for a basic Fedora CoreOS + Portainer installation
variant: fcos
version: 1.5.0
passwd:
users:
- name: core
ssh_authorized_keys:
- ssh-rsa ...
storage:
disks:
- device: /dev/disk/by-id/coreos-boot-disk
wipe_table: false
partitions:
- number: 4
label: root
size_mib: 8192
resize: true
- size_mib: 0
label: var
filesystems:
- path: /var
device: /dev/disk/by-partlabel/var
format: xfs
with_mount_unit: true
files:
- path: /etc/hostname
mode: 0644
contents:
inline: |
marika
- path: /etc/sysctl.d/99-custom.conf
contents:
inline: |
net.core.rmem_max=4194304
net.core.wmem_max=1048576
- path: /etc/sysconfig/docker
overwrite: true
contents:
inline: |
OPTIONS="--selinux-enabled \
--log-driver=journald \
--live-restore \
--init-path /usr/libexec/docker/docker-init \
--userland-proxy-path /usr/libexec/docker/docker-proxy \
"
- path: /etc/modprobe.d/i915.conf
contents:
inline: |
options i915 enable_guc=2
systemd:
units:
- name: docker-portainer.service
enabled: true
contents: |-
[Unit]
Description=Portainer Admin Container
After=docker.service
Requires=docker.service network.target network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull portainer/portainer-ce
ExecStartPre=mkdir -p /var/mounts/portainer/data
# Privileged mode is required for binding to local socket to work due to SELINUX (https://github.com/portainer/portainer/issues/849)
ExecStart=/usr/bin/docker run --ulimit nofile=65536 --privileged=true -d -p 2000:9000 --name %n --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /var/mounts/portainer/data:/data portainer/portainer-ce
ExecStop=/usr/bin/docker stop -t 15 %n
[Install]
WantedBy=multi-user.target
- name: var-mnt-media.mount
enabled: true
contents: |
[Unit]
Description=Mount media directory
[Mount]
What=gideon.lan:/volume1/Media
Where=/var/mnt/media
Type=nfs4
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment