diff --git a/src/faaso.cr b/src/faaso.cr index 7e3b789..cc4d1cd 100644 --- a/src/faaso.cr +++ b/src/faaso.cr @@ -1,4 +1,6 @@ require "commander" +require "docr" +require "docr/utils.cr" require "file_utils" require "uuid" @@ -29,8 +31,9 @@ module Faaso Dir.glob(arg + "/**/*").each do |file| FileUtils.cp(file, tmp_dir) end - # TODO: build Docker image + docker_api = Docr::API.new(Docr::Client.new) + docker_api.images.build(context: tmp_dir, tags: ["func"]) { } # TODO: push Docker image to registry # TODO: return image name for testing end diff --git a/templates/crystal/Dockerfile b/templates/crystal/Dockerfile index 20a8453..44fbefb 100644 --- a/templates/crystal/Dockerfile +++ b/templates/crystal/Dockerfile @@ -4,7 +4,7 @@ RUN apk update && apk upgrade && apk add crystal shards openssl-dev zlib-dev && WORKDIR /home/app -COPY shard.yml *.cr . +COPY shard.yml *.cr ./ RUN shards install RUN shards build