Build image using docr

This commit is contained in:
Roberto Alsina 2024-06-28 17:42:10 -03:00
parent 7a37fbd583
commit cbbe739b82
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,6 @@
require "commander" require "commander"
require "docr"
require "docr/utils.cr"
require "file_utils" require "file_utils"
require "uuid" require "uuid"
@ -29,8 +31,9 @@ module Faaso
Dir.glob(arg + "/**/*").each do |file| Dir.glob(arg + "/**/*").each do |file|
FileUtils.cp(file, tmp_dir) FileUtils.cp(file, tmp_dir)
end end
# TODO: build Docker image # 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: push Docker image to registry
# TODO: return image name for testing # TODO: return image name for testing
end end

View File

@ -4,7 +4,7 @@ RUN apk update && apk upgrade && apk add crystal shards openssl-dev zlib-dev &&
WORKDIR /home/app WORKDIR /home/app
COPY shard.yml *.cr . COPY shard.yml *.cr ./
RUN shards install RUN shards install
RUN shards build RUN shards build