Use asciinema binary as entrypoint in Docker container

This commit is contained in:
Marcin Kulik
2019-01-12 20:33:08 +01:00
parent cc73910933
commit 4633c87c77
2 changed files with 7 additions and 5 deletions

View File

@@ -19,4 +19,4 @@ ENV LANG en_US.utf8
ENV SHELL /bin/bash ENV SHELL /bin/bash
ENV USER docker ENV USER docker
WORKDIR /root WORKDIR /root
CMD ["asciinema", "rec"] ENTRYPOINT ["/usr/local/bin/asciinema"]

View File

@@ -105,17 +105,19 @@ asciinema recorder pre-installed.
When running it don't forget to allocate a pseudo-TTY (`-t`), keep STDIN open When running it don't forget to allocate a pseudo-TTY (`-t`), keep STDIN open
(`-i`) and mount config directory volume (`-v`): (`-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 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 want to install extra programs before recording. One option is to derive new
image from this one (start your custom Dockerfile with `FROM image from this one (start your custom Dockerfile with `FROM
asciinema/asciinema`). Another option is to start the container with `/bin/bash` 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:~# apt-get install foobar
root@6689517d99a1:~# asciinema rec root@6689517d99a1:~# asciinema rec