IntersectMBO / cardano-addresses

Addresses and mnemonic manipulation & derivations
Apache License 2.0
146 stars 46 forks source link

Error when attempting to build Docker image on Linux #116

Closed catch-21 closed 1 week ago

catch-21 commented 3 years ago

Description

Following the steps in the readme, when running attempting to build Docker image I'm hitting an error blocking me from proceeding.

Steps:

  1. Checkout this repo
  2. $ docker build -t cardano-address .

    Result:

    Step 5/21 : COPY stack.yaml . COPY failed: file not found in build context or excluded by .dockerignore: stat stack.yaml: file does not exist

Environment

Linux Mint 20 (Ulyana) Docker version 20.10.5, build 55c4c88 cardano-addresses commit 55f174b

catch-21 commented 3 years ago

Full logs

$ docker build -t cardano-address . Sending build context to Docker daemon 753.2kB Step 1/21 : FROM haskell:8.6.5 as build ---> 933dea80169e Step 2/21 : WORKDIR /build ---> Running in 9625b79002d3 Removing intermediate container 9625b79002d3 ---> f8cf4b4342a5 Step 3/21 : RUN apt-get update && apt-get install --no-install-recommends -y build-essential=12.3 git=1:2.11.* ---> Running in 0c51ef802a3c Ign:1 http://deb.debian.org/debian stretch InRelease Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB] Get:3 http://downloads.haskell.org/debian stretch InRelease [2517 B] Get:4 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB] Get:5 http://deb.debian.org/debian stretch Release [118 kB] Get:6 http://deb.debian.org/debian stretch Release.gpg [2410 B] Get:7 http://downloads.haskell.org/debian stretch/main amd64 Packages [33.4 kB] Get:8 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [665 kB] Get:9 http://deb.debian.org/debian stretch-updates/main amd64 Packages [2596 B] Get:10 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB] Fetched 8050 kB in 3s (2048 kB/s) Reading package lists... Reading package lists... Building dependency tree... Reading state information... git is already the newest version (1:2.11.0-3+deb9u7). The following additional packages will be installed: bzip2 dpkg-dev patch Suggested packages: bzip2-doc debian-keyring ed diffutils-doc Recommended packages: fakeroot libalgorithm-merge-perl The following NEW packages will be installed: build-essential bzip2 dpkg-dev patch 0 upgraded, 4 newly installed, 0 to remove and 33 not upgraded. Need to get 1762 kB of archives. After this operation, 2348 kB of additional disk space will be used. Get:1 http://deb.debian.org/debian stretch/main amd64 bzip2 amd64 1.0.6-8.1 [47.5 kB] Get:2 http://deb.debian.org/debian stretch/main amd64 patch amd64 2.7.5-1+deb9u2 [112 kB] Get:3 http://deb.debian.org/debian stretch/main amd64 dpkg-dev all 1.18.25 [1595 kB] Get:4 http://deb.debian.org/debian stretch/main amd64 build-essential amd64 12.3 [7346 B] debconf: delaying package configuration, since apt-utils is not installed Fetched 1762 kB in 0s (3254 kB/s) Selecting previously unselected package bzip2. (Reading database ... 16535 files and directories currently installed.) Preparing to unpack .../bzip2_1.0.6-8.1_amd64.deb ... Unpacking bzip2 (1.0.6-8.1) ... Selecting previously unselected package patch. Preparing to unpack .../patch_2.7.5-1+deb9u2_amd64.deb ... Unpacking patch (2.7.5-1+deb9u2) ... Selecting previously unselected package dpkg-dev. Preparing to unpack .../dpkg-dev_1.18.25_all.deb ... Unpacking dpkg-dev (1.18.25) ... Selecting previously unselected package build-essential. Preparing to unpack .../build-essential_12.3_amd64.deb ... Unpacking build-essential (12.3) ... Setting up bzip2 (1.0.6-8.1) ... Setting up patch (2.7.5-1+deb9u2) ... Setting up dpkg-dev (1.18.25) ... Setting up build-essential (12.3) ... Removing intermediate container 0c51ef802a3c ---> 04baac29b817 Step 4/21 : RUN stack upgrade --binary-version 2.1.3 ---> Running in d580734c506c Current Stack version: 1.9.3, available download version: 2.1.3 Newer version detected, downloading Querying for archive location for platform: linux-x86_64-static Downloading from: https://github.com/commercialhaskell/stack/releases/download/v2.1.3/stack-2.1.3-linux-x86_64-static.tar.gz Download complete, testing executable Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86_64 hpack-0.31.2 New stack executable available at /root/.local/bin/stack Also copying stack executable to /usr/local/bin/stack Stack executable copied successfully! Removing intermediate container d580734c506c ---> 30106576c68a Step 5/21 : COPY stack.yaml . COPY failed: file not found in build context or excluded by .dockerignore: stat stack.yaml: file does not exist

piotr-iohk commented 3 years ago

Seems to work for me on Ubuntu 20.04:

$ cd cardano-addresses
$ docker build -t cardano-address .

Sending build context to Docker daemon  193.5MB
Step 1/21 : FROM haskell:8.6.5 as build
 ---> 933dea80169e
Step 2/21 : WORKDIR /build
 ---> Using cache
 ---> ea8a82870cfd
Step 3/21 : RUN apt-get update && apt-get install --no-install-recommends -y   build-essential=12.3   git=1:2.11.*
 ---> Using cache
 ---> 264bf32445d9
Step 4/21 : RUN stack upgrade --binary-version 2.1.3
 ---> Using cache
 ---> e5bff4facf7a
Step 5/21 : COPY stack.yaml .
 ---> Using cache
 ---> d71e097db5c5
Step 6/21 : RUN mkdir -p command-line core
 ---> Using cache
 ---> 0492737420cf
Step 7/21 : COPY core/package.yaml core/package.yaml
 ---> Using cache
 ---> a4293374e5db
Step 8/21 : COPY command-line/package.yaml command-line/package.yaml
 ---> Using cache
 ---> 3a43d65f54c9
Step 9/21 : RUN stack setup
 ---> Using cache
 ---> 6287d111e72f
Step 10/21 : RUN stack build --only-snapshot
 ---> Using cache
 ---> 4f62621fda76
Step 11/21 : RUN stack build --only-dependencies
 ---> Using cache
 ---> 2be783edb031
Step 12/21 : COPY . .
 ---> Using cache
 ---> 38644a80375c
Step 13/21 : RUN stack install --flag cardano-addresses:release
 ---> Using cache
 ---> fb8366399157
Step 14/21 : FROM frolvlad/alpine-glibc:alpine-3.11_glibc-2.30
 ---> a328c7d8396d
Step 15/21 : RUN apk add --no-cache gmp=6.1.2-r1 bash=5.0.11-r1 bash-completion=2.9-r0
 ---> Using cache
 ---> 0d13bb35306a
Step 16/21 : COPY --from=build /root/.local/bin /bin
 ---> Using cache
 ---> f0cecd1436af
Step 17/21 : RUN mkdir /etc/bash_completion.d
 ---> Using cache
 ---> e5ebaa964486
Step 18/21 : RUN cardano-address --bash-completion-script `which cardano-address` > /etc/bash_completion.d/cardano-address
 ---> Using cache
 ---> 434fc2d2b0cc
Step 19/21 : RUN echo "source /etc/bash_completion.d/cardano-address" >> ~/.bashrc
 ---> Using cache
 ---> fdfdc4576840
Step 20/21 : RUN echo "cardano-address --help" >> ~/.bashrc
 ---> Using cache
 ---> 64c9e563d371
Step 21/21 : ENTRYPOINT ["cardano-address"]
 ---> Using cache
 ---> 2cf908063291
Successfully built 2cf908063291
Successfully tagged cardano-address:latest
catch-21 commented 3 years ago

I have discovered this is not an issue with Docker build. I hit an error with cloning the repo. fatal: cannot create directory at 'core/test/golden/addresses_excess_behave_track_soul_table_wear_ocean_cash_stay_nature_item_turtle_palm_soccer_lunch_horror_start_stumble_month_panic_right_must_lock_dress': File name too long.

Closing issue.

rvl commented 3 years ago

We should make those filenames shorter - reopening.

Karakatiza666 commented 2 years ago

I was trying to build plutus-pioneer-program with cabal on Alpine Linux WSL. Still an issue. HEAD is now at 3825d3a Merge pull request #9 from input-output-hk/coot/createNamedPipe-error fatal: cannot create directory at 'core/test/golden/addresses_draft_ability_female_child_jump_maid_roof_hurt_below_live_topple_paper_exclude_ordinary_coach_churn_sunset_emerge_blame_ketchup_much': Filename too long