-
Notifications
You must be signed in to change notification settings - Fork 79
Dockerize #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Dockerize #48
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| FROM ubuntu:16.04 | ||
|
|
||
| RUN apt-get update | ||
| RUN apt-get install -y \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be combined into a single command with Also clean the apt cache after installing packages. See the apt-get recommendations here. |
||
| libgtk-3-dev \ | ||
| libtomcrypt-dev \ | ||
| libxml2-dev \ | ||
| libtomcrypt-dev \ | ||
| autoconf \ | ||
| automake \ | ||
| libtool \ | ||
| build-essential \ | ||
| git | ||
|
|
||
| RUN git clone git://github.com/cernekee/stoken | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| WORKDIR stoken | ||
|
|
||
| RUN bash autogen.sh && \ | ||
| ./configure && \ | ||
| make && \ | ||
| make check && \ | ||
| make install && \ | ||
| ldconfig | ||
|
|
||
| CMD stoken | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ## Build container | ||
| build: | ||
| @bash -x scripts/build.sh | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I was kind of wondering if it is more common for Docker users to invoke For
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly I think it's more common for Docker users to run docker commands themselves. If I saw a Dockerfile in a project, it would be logical that I can simply do I'm not sure these make targets or helper scripts provide much value.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In short, as a first step, I would probably just commit docker/Dockerfile and leave it at that. Most Docker users and tools know what to do with that. |
||
|
|
||
| ## Push container | ||
| push: | ||
| @bash -x scripts/push.sh | ||
|
|
||
| ## Run project | ||
| run: | ||
| @bash -x scripts/run.sh | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, just inline the command here. |
||
|
|
||
| help: | ||
| @printf "Available targets:\n\n" | ||
| @awk '/^[a-zA-Z\-\_0-9%:\\]+:/ { \ | ||
| helpMessage = match(lastLine, /^## (.*)/); \ | ||
| if (helpMessage) { \ | ||
| helpCommand = $$1; \ | ||
| helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \ | ||
| gsub("\\\\", "", helpCommand); \ | ||
| gsub(":+$$", "", helpCommand); \ | ||
| printf " \x1b[32;01m%-35s\x1b[0m %s\n", helpCommand, helpMessage; \ | ||
| } \ | ||
| } \ | ||
| { lastLine = $$0 }' $(MAKEFILE_LIST) | sort -u | ||
| @printf "\n" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/bash | ||
| set -ex | ||
|
|
||
| docker build -t stevemcquaid/stoken:latest . | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Obviously without your user name hard coded here. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/bash | ||
|
|
||
| docker run -it -v $HOME:/root stevemcquaid/stoken:latest stoken $@ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same user name issue here. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These large tabs should be reduced to a single space, I have never seen a Dockerfile formatted this way.