Skip to content

Commit

Permalink
feat(pv): ✨ Add a dockerfile to pv example
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisguest75 committed Jul 31, 2024
1 parent faf18c9 commit 2ef33e4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 84_pv_progress/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
random.bin

11 changes: 11 additions & 0 deletions 84_pv_progress/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# syntax=docker/dockerfile:1.4
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -fy -qq --no-install-recommends bash ca-certificates pv \
&& apt-get clean

WORKDIR /scratch
CMD [ "/bin/bash" ]
14 changes: 14 additions & 0 deletions 84_pv_progress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pv - monitor the progress of data through a pipe
- [PV](#pv)
- [Contents](#contents)
- [Install](#install)
- [Docker](#docker)
- [Examples](#examples)
- [Measure the time taken to read a large file](#measure-the-time-taken-to-read-a-large-file)
- [Measure the time taken to compress a large file to GZIP](#measure-the-time-taken-to-compress-a-large-file-to-gzip)
Expand All @@ -21,9 +22,22 @@ brew info pv
brew install pv
```

## Docker

```sh
# build the image
docker build --no-cache --progress=plain -f Dockerfile -t pv .
# run a command
docker run --rm -it --entrypoint /bin/bash pv
```

## Examples

```sh
# generate 1GB file
dd if=/dev/urandom of=random.bin bs=1G count=1

FILEPATH=./random.bin
FILEPATH=./cv-corpus-16.1-2023-12-06-fr.tar
```

Expand Down

0 comments on commit 2ef33e4

Please sign in to comment.