Skip to content

Commit

Permalink
Use asciinema binary as entrypoint in Docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Jan 12, 2019
1 parent cc73910 commit 4633c87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4633c87

Please sign in to comment.