From 4633c87c77922ec5903965306ecff45531b72092 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Sat, 12 Jan 2019 20:33:08 +0100 Subject: [PATCH] Use asciinema binary as entrypoint in Docker container --- Dockerfile | 2 +- README.md | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b4e9ea2..0c037a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,4 +19,4 @@ ENV LANG en_US.utf8 ENV SHELL /bin/bash ENV USER docker WORKDIR /root -CMD ["asciinema", "rec"] +ENTRYPOINT ["/usr/local/bin/asciinema"] diff --git a/README.md b/README.md index 5ce43c0..8a1c58e 100644 --- a/README.md +++ b/README.md @@ -105,17 +105,19 @@ asciinema recorder pre-installed. When running it don't forget to allocate a pseudo-TTY (`-t`), keep STDIN open (`-i`) and mount config directory volume (`-v`): - docker run --rm -ti -v "$HOME/.config/asciinema":/root/.config/asciinema asciinema/asciinema + docker run --rm -ti -v "$HOME/.config/asciinema":/root/.config/asciinema asciinema/asciinema rec -Default command run in a container is `asciinema rec`. +Container's entrypoint is set to `/usr/local/bin/asciinema` so you can run the +container with any arguments you would normally pass to `asciinema` binary (see +Usage section for commands and options). There's not much software installed in this image though. In most cases you may want to install extra programs before recording. One option is to derive new image from this one (start your custom Dockerfile with `FROM asciinema/asciinema`). Another option is to start the container with `/bin/bash` -as the command, install extra packages and manually start `asciinema rec`: +as the entrypoint, install extra packages and manually start `asciinema rec`: - docker run --rm -ti -v "$HOME/.config/asciinema":/root/.config/asciinema asciinema/asciinema /bin/bash + docker run --rm -ti -v "$HOME/.config/asciinema":/root/.config/asciinema --entrypoint=/bin/bash asciinema/asciinema root@6689517d99a1:~# apt-get install foobar root@6689517d99a1:~# asciinema rec