Compare commits
No commits in common. "18da11d77943a2e26448eef78c14c22f29818f9e" and "7f18247e009775f81be09b3ddeec03f7c1238801" have entirely different histories.
18da11d779
...
7f18247e00
@ -1 +1 @@
|
||||
2
|
||||
1
|
||||
|
||||
@ -14,6 +14,7 @@ ENV PACKAGE_VERSION=${PACKAGE_VERSION}
|
||||
|
||||
# Copy nfpm.yaml from the context into the container
|
||||
COPY nfpm.yaml /app/nfpm.yaml
|
||||
COPY resources /app/resources
|
||||
|
||||
# Download the required files
|
||||
RUN wget -O /app/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz https://github.com/etcd-io/etcd/releases/download/v${PACKAGE_VERSION}/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz && \
|
||||
|
||||
@ -45,3 +45,16 @@ contents:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
- src: /app/resources/etcd.service
|
||||
dst: /usr/lib/systemd/system/etcd.service
|
||||
file_info:
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
# Scripts to run during installation/removal (optional)
|
||||
scripts:
|
||||
preinstall: ./resources/scripts/preinstall.sh
|
||||
postinstall: ./resources/scripts/postinstall.sh
|
||||
preremove: ./resources/scripts/preremove.sh
|
||||
postremove: ./resources/scripts/postremove.sh
|
||||
|
||||
18
rpms/etcd/resources/etcd.service
Normal file
18
rpms/etcd/resources/etcd.service
Normal file
@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=etcd key-value store
|
||||
Documentation=https://github.com/etcd-io/etcd
|
||||
After=network-online.target local-fs.target remote-fs.target time-sync.target
|
||||
Wants=network-online.target local-fs.target remote-fs.target time-sync.target
|
||||
|
||||
[Service]
|
||||
User=etcd
|
||||
Type=notify
|
||||
Environment=ETCD_DATA_DIR=/var/lib/etcd
|
||||
Environment=ETCD_NAME=%m
|
||||
ExecStart=/usr/bin/etcd
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
LimitNOFILE=40000
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
2
rpms/etcd/resources/scripts/postinstall.sh
Executable file
2
rpms/etcd/resources/scripts/postinstall.sh
Executable file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
systemctl daemon-reload
|
||||
3
rpms/etcd/resources/scripts/postremove.sh
Executable file
3
rpms/etcd/resources/scripts/postremove.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
rm -f /usr/lib/systemd/system/etcd.service
|
||||
systemctl daemon-reload
|
||||
5
rpms/etcd/resources/scripts/preinstall.sh
Executable file
5
rpms/etcd/resources/scripts/preinstall.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
groupadd --system etcd
|
||||
useradd --system --shell /sbin/nologin --no-create-home --home-dir /var/lib/etcd --gid etcd etcd
|
||||
mkdir -p /var/lib/etcd
|
||||
chown etcd:etcd /var/lib/etcd
|
||||
2
rpms/etcd/resources/scripts/preremove.sh
Executable file
2
rpms/etcd/resources/scripts/preremove.sh
Executable file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
systemctl stop etcd.service
|
||||
Loading…
Reference in New Issue
Block a user