Today's container: JSON resume cli

image

Today's task ended up being to update my Resume. Well, it turns out it was time to create a new one – so I turned to JSON Resume CLI – which converts the machine readable info I maintain into something that doesn't look like the word document I've been carrying around since I graduated in 1995.

Happily, node.js works well using alpine, so my Dockerfile (see the GH repo for more) looks like:

FROM alpine EXPOSE 4000

WORKDIR /data

ENTRYPOINT ["resume"] RUN apk add --no-cache nodejs \

&& npm install -g resume-cli \

&& sed -i~ "s/localhost/0.0.0.0/g" /usr/lib/node_modules/resume-cli/index.js /usr/lib/node_modules/resume-cli/lib/serve.js

Pretty simple – but it means that I don't have to install node.js on whatever computers I'm using – today I was using 3 different computers..

The most important thing to note is the ENTRYPOINT ["resume"] – it means that you can alias a “docker run” command that will work as though the program was installed on your host:

$ alias resume='docker run --rm -it -v $(pwd):/data/ -p 4000:4000 svendowideit/jsonresume'

$ resume --help

Checking NPM for latest version...

Your resume-cli software is up-to-date.

Usage: resume [command] [options]

Commands:

init Initialize a resume.json file

register Register an account at https://registry.jsonresume.org

login Stores a user session.

settings Change theme, change password, delete account.

test Schema validation test your resume.json

export [fileName] Export locally to .html or .pdf. Supply a --format flag and argument to specify export format.

publish Publish your resume to https://registry.jsonresume.org

serve Serve resume at http://0.0.0.0:4000/

Options:

-h, --help output usage information

-V, --version output the version number

-t, --theme Specify theme for export or publish (modern, traditional, crisp)

-F, --force Used by publish - bypasses schema testing.

-f, --format Used by export.

-r, --resume Used by serve (default: resume.json)

-p, --port Used by serve (default: 4000)

-s, --silent Used by serve to tell it if open browser auto or not.

-d, --dir Used by serve to indicate a public directory path.

I guess I can pop back up my todo stack to the Android Studio container I started yesterday 🙂