From aa231cec27fc3b73ca9560e70cadee7f37f834e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20=C5=A0ima?= Date: Sat, 9 Nov 2019 22:34:20 +0000 Subject: [PATCH] Feature/smaller docker image --- .dockerignore | 1 - .gitlab-ci.yml | 11 ++++++----- dist/.gitignore | 4 ---- docker/distribution/debian/distribute.Dockerfile | 9 +++++++++ docker/distribution/debian/package.Dockerfile | 2 +- scripts/build_docker_image.sh | 2 +- 6 files changed, 17 insertions(+), 12 deletions(-) delete mode 100644 dist/.gitignore diff --git a/.dockerignore b/.dockerignore index ccf03db24..b20e30eb1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ -dist _opam _build docker diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9589ea238..2aa87413e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,10 +5,10 @@ variables: package_binary_script: "./scripts/distribution/generic/package.sh" stages: - - build_docker - test - - build_and_deploy_docker - build_and_package_binaries + - build_docker + - build_and_deploy_docker - build_and_deploy_website .build_binary: &build_binary @@ -19,9 +19,6 @@ stages: artifacts: paths: - dist/package/**/* - only: - - master - - dev .website_build: &website_build stage: build_and_deploy_website @@ -92,6 +89,8 @@ local-dune-job: # Run a docker build without publishing to the registry build-current-docker-image: stage: build_docker + dependencies: + - build-and-package-debian-10 <<: *docker script: - sh scripts/build_docker_image.sh @@ -105,6 +104,8 @@ build-current-docker-image: build-and-publish-latest-docker-image: stage: build_and_deploy_docker <<: *docker + dependencies: + - build-and-package-debian-10 script: - sh scripts/build_docker_image.sh - sh scripts/test_cli.sh diff --git a/dist/.gitignore b/dist/.gitignore deleted file mode 100644 index 86d0cb272..000000000 --- a/dist/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/docker/distribution/debian/distribute.Dockerfile b/docker/distribution/debian/distribute.Dockerfile index e69de29bb..ad4fbbeec 100644 --- a/docker/distribution/debian/distribute.Dockerfile +++ b/docker/distribution/debian/distribute.Dockerfile @@ -0,0 +1,9 @@ +FROM jgoerzen/debian-base-minimal:buster + +COPY ./dist/package/debian-10 /package/dist + +RUN apt-get update -qq +RUN apt-get -y -f install "/package/dist/$(ls /package/dist)" +RUN rm -r /package/dist + +ENTRYPOINT [ "ligo" ] \ No newline at end of file diff --git a/docker/distribution/debian/package.Dockerfile b/docker/distribution/debian/package.Dockerfile index 440496521..6debfad84 100644 --- a/docker/distribution/debian/package.Dockerfile +++ b/docker/distribution/debian/package.Dockerfile @@ -19,7 +19,7 @@ RUN echo "Package: ligo\n\ Version: $version\n\ Architecture: all\n\ Maintainer: info@ligolang.org\n\ -Depends: libev-dev, perl, pkg-config, libgmp-dev, libhidapi-dev, m4, libcap-dev, bubblewrap, rsync\n\ +Depends: libev4, libgmp10, libgmpxx4ldbl, cpp\n\ Homepage: http://ligolang.org\n\ Description: LIGO is a statically typed high-level smart-contract language that compiles down to Michelson." >> /package/DEBIAN/control diff --git a/scripts/build_docker_image.sh b/scripts/build_docker_image.sh index 21e3a2bf5..260a530c7 100755 --- a/scripts/build_docker_image.sh +++ b/scripts/build_docker_image.sh @@ -1,3 +1,3 @@ #!/bin/sh set -e -docker build --build-arg target="4.07" -t "${LIGO_REGISTRY_IMAGE_BUILD:-ligolang/ligo}:next" -f ./docker/distribution/generic/build.Dockerfile . +docker build -t "${LIGO_REGISTRY_IMAGE_BUILD:-ligolang/ligo}:next" -f ./docker/distribution/debian/distribute.Dockerfile . \ No newline at end of file