Skip to content

Commit

Permalink
Update libguestfs-tools-Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
doomedraven authored Sep 2, 2023
1 parent d89dcad commit b891505
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Virtualization/libguestfs-tools-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@

# Running
# sudo docker run -it --rm --privileged -v /opt/VMs:/mnt/vm-disks guest-fs-tools
# docker exec -it $(docker container ls | grep 'guest-fs-tools' | awk '{print $1}') /usr/bin/virt-sparsify path_to_vm path_to_out_vm --tmp /mnt/vm-disks
# docker exec -it $(docker container ls | grep 'guest-fs-tools' | awk '{print $1}') sudo /usr/bin/virt-sparsify path_to_vm path_to_out_vm --tmp /mnt/vm-disks
# Might need another volume mount which contains more space
# last command inside docker might require sudo

FROM ubuntu:22.04
ARG username=tracker
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ jammy universe" >> /etc/apt/sources.list && \
apt-get update && apt-get install -y --no-install-recommends libguestfs-tools software-properties-common sudo apt-utils
RUN useradd -ms /bin/bash -d /home/${username} ${username} && usermod -aG sudo $username && echo "$username ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
ENV HOME=/home/${username}
USER ${username}
apt-get update && apt-get install -y --no-install-recommends libguestfs-tools software-properties-common sudo apt-utils linux-image-generic
RUN useradd -ms /bin/bash -d /home/docker docker && usermod -aG sudo docker && echo "docker ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
ENV HOME=/home/docker
USER docker

0 comments on commit b891505

Please sign in to comment.