Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run fstrim (try to reduce image size) #144

Merged
merged 2 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ jobs:
HCP_CLIENT_ID: ${{ secrets.HCP_CLIENT_ID }}
HCP_CLIENT_SECRET: ${{ secrets.HCP_CLIENT_SECRET }}
PACKER_LOG: 1
- run: du -h *.box
working-directory: src
- run: mkdir test
- run: vagrant plugin install --verbose vagrant-libvirt
working-directory: test
Expand Down
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 -v /",
]
}

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 -v /",
]
}

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 -v /",
]
}

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 -v /",
]
}

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
Loading