From 09ffcd6d1a64cd534f750dc817e00b335b57a937 Mon Sep 17 00:00:00 2001 From: James Tooze Date: Fri, 5 May 2023 10:38:37 -0700 Subject: [PATCH] Docker updates - Updates Docker base image from Ubuntu 18.04 (now EOL) to Ubuntu 22.04 (current LTS release) - Adds Makefile target to build Docker image. Especially useful since recommended Docker image `peron/f3` is out of date (as of May 2023) - Updates README self-built Docker image usage instructions --- Dockerfile | 4 ++-- Makefile | 3 +++ README.rst | 12 ++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 04df6b0..3d53a3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM ubuntu:18.04 +FROM ubuntu:22.04 RUN apt-get update && \ apt-get install -y --no-install-recommends \ gcc \ less \ - libparted0-dev \ + libparted-dev \ libudev1 \ libudev-dev \ make \ diff --git a/Makefile b/Makefile index 67d277a..20af8a7 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,9 @@ endif all: $(TARGETS) extra: $(EXTRA_TARGETS) +docker: + docker build -f Dockerfile -t f3:latest . + install: all $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin $(INSTALL) -m755 $(TARGETS) $(DESTDIR)$(PREFIX)/bin diff --git a/README.rst b/README.rst index 6be1091..a57fb7f 100644 --- a/README.rst +++ b/README.rst @@ -202,9 +202,21 @@ For example, to probe a drive mounted at /dev/sdX:: Optionally, you can also build your own container *if* you don't want to use the pre-built image. From this directory, run:: + make docker + +or:: + docker build -t f3:latest . + + +To run f3 commands using your newly built Docker image:: + docker run -it --rm --device f3:latest [] + docker run -it --rm --device /dev/sdX f3:latest f3probe --destructive --time-ops /dev/sdX + docker run -it --rm -v /path/to/mounted/device:/mnt/ f3:latest f3write /mnt/ + docker run -it --rm -v /path/to/mounted/device:/mnt/ f3:latest f3read /mnt/ + Drive Permissions / Passthrough ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~