docker: add rake task for building Docker image.

Add a Rake task for building a Docker image. Usage:

* bin/rails danbooru:docker:build
* sudo docker run --rm -it danbooru
This commit is contained in:
evazion
2021-05-02 17:42:11 -05:00
parent ca34d502c8
commit d825bb144b

10
lib/tasks/danbooru.rake Normal file
View File

@@ -0,0 +1,10 @@
namespace :danbooru do
namespace :docker do
# Note that uncommited changes won't be included in the image; commit
# changes first before building the image.
desc "Build a Docker image based on latest commit"
task :build do
system("git archive HEAD | docker build - --build-arg SOURCE_COMMIT=$(git rev-parse HEAD) -t danbooru -f Dockerfile")
end
end
end