Skip to content

Commit

Permalink
🚧 Add VHS to Docker build
Browse files Browse the repository at this point in the history
Add VHS to Docker build to enable recording the demo animation. There
is a known performance issue caused by CPU requirements exceed current
machine. This causes frames to be dropped which results in the video
playback being faster than normal.
  • Loading branch information
mikelorant committed Mar 6, 2024
1 parent 30b5445 commit 53c0baf
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 8 deletions.
34 changes: 33 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1.4

FROM golang:1.19.4-alpine3.17 as base
WORKDIR /usr/src/app
RUN --mount=type=cache,target=/var/cache/apk \
Expand Down Expand Up @@ -43,4 +45,34 @@ RUN git config --global user.email "[email protected]" && \
git config --global user.name "Your Name" && \
git init

ENTRYPOINT ["committed"]
FROM mikelorant/vhs as vhs

RUN apt-get -y install git

COPY --from=build /usr/local/bin/committed /usr/local/bin

ENV VHS_NO_SANDBOX="true"
ENV TERM=xterm-256color

RUN git config --global user.email "[email protected]" && \
git config --global user.name "John Doe" && \
git init

RUN mkdir -p /root/.config/committed
COPY <<EOF /root/.config/committed/config.yaml
view:
compatibility: ttyd
ignoreGlobalAuthor: true

authors:
- name: John Doe
email: [email protected]
- name: John Doe
email: [email protected]
- name: John Doe
email: [email protected]
EOF

COPY scripts ./

ENTRYPOINT ["bash"]
8 changes: 1 addition & 7 deletions scripts/demo.tape
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
# - Use ttyd 1.7.2 which resolves missing cursor.
# - Use current build of vhs to resolve width issues.
# - Modify high-voltage with basic version. (emoji.yaml)
# - Copy $HOME/.config/committed/config.yaml to current directory.
# - Modify config to use:
# view.compatibility = ttyd (config.yaml)
# authors:
# - name: John Doe
# email: [email protected]
# - Comment out user in Git config. (~/.gitconfig)
# - Copy scripts/demo.yaml to current directory.
# - Build release: go build -tags release

Output demo.gif
Expand Down
9 changes: 9 additions & 0 deletions scripts/demo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
view:
compatibility: ttyd
ignoreGlobalAuthor: true

authors:
- name: John Doe
email: [email protected]
- name: John Doe
email: [email protected]

0 comments on commit 53c0baf

Please sign in to comment.