Skip to content

Commit

Permalink
Run fstrim (try to reduce image size)
Browse files Browse the repository at this point in the history
  • Loading branch information
amezin committed Jan 5, 2025
1 parent e9b1542 commit 607315f
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions alpine-3.18.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ build {
"usermod -p '${bcrypt("vagrant")}' root",
"echo 'permit nopass :vagrant' >/etc/doas.d/vagrant.conf",
"rm -rf /var/cache/apk/*",
"fstrim -av --quiet-unsupported",
]
}

Expand Down
1 change: 1 addition & 0 deletions alpine-3.19.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ build {
"usermod -p '${bcrypt("vagrant")}' root",
"echo 'permit nopass :vagrant' >/etc/doas.d/vagrant.conf",
"rm -rf /var/cache/apk/*",
"fstrim -av --quiet-unsupported",
]
}

Expand Down
1 change: 1 addition & 0 deletions alpine-3.20.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ build {
"usermod -p '${bcrypt("vagrant")}' root",
"echo 'permit nopass :vagrant' >/etc/doas.d/vagrant.conf",
"rm -rf /var/cache/apk/*",
"fstrim -av --quiet-unsupported",
]
}

Expand Down
1 change: 1 addition & 0 deletions alpine-3.21.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ build {
"usermod -p '${bcrypt("vagrant")}' root",
"echo 'permit nopass :vagrant' >/etc/doas.d/vagrant.conf",
"rm -rf /var/cache/apk/*",
"fstrim -av --quiet-unsupported",
]
}

Expand Down
1 change: 1 addition & 0 deletions debian-12.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ build {
provisioner "shell" {
inline = [
"apt-get clean -y",
"sudo fstrim -av --quiet-unsupported",
]
}

Expand Down
2 changes: 2 additions & 0 deletions fedora.ks
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ sed -i -e "s/.*PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
sed -i -e "s/.*PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config
dnf clean all -y
fstrim -av --quiet-unsupported
%end
6 changes: 6 additions & 0 deletions opensuse-leap-15.6.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ build {
"source.qemu.opensuseleap156"
]

provisioner "shell" {
inline = [
"sudo fstrim -av --quiet-unsupported",
]
}

post-processors {
post-processor "vagrant" {
vagrantfile_template = "Vagrantfile"
Expand Down
6 changes: 6 additions & 0 deletions opensuse-tumbleweed.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ build {
"source.qemu.opensusetumbleweed"
]

provisioner "shell" {
inline = [
"sudo fstrim -av --quiet-unsupported",
]
}

post-processors {
post-processor "vagrant" {
vagrantfile_template = "Vagrantfile"
Expand Down
2 changes: 2 additions & 0 deletions silverblue.ks
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ chmod 0440 /etc/sudoers.d/vagrant

sed -i -e "s/.*PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
sed -i -e "s/.*PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config

fstrim -av --quiet-unsupported
%end
1 change: 1 addition & 0 deletions ubuntu-22.04.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ build {
provisioner "shell" {
inline = [
"sudo apt-get clean -y",
"sudo fstrim -av --quiet-unsupported",
]
}

Expand Down
1 change: 1 addition & 0 deletions ubuntu-24.04.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ build {
provisioner "shell" {
inline = [
"sudo apt-get clean -y",
"sudo fstrim -av --quiet-unsupported",
]
}

Expand Down
1 change: 1 addition & 0 deletions ubuntu-24.10.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ build {
provisioner "shell" {
inline = [
"sudo apt-get clean -y",
"sudo fstrim -av --quiet-unsupported",
]
}

Expand Down

0 comments on commit 607315f

Please sign in to comment.