Fix bug/incompatibility in Makefile
Trying this out, I found that the current state of the files does not build a docker image.
The Makefile contains an incompatible/buggy cp
command:
thomas@okeanos hdbpp-mysql-docker (master) 157: make
mkdir -p build-files/
cp -rf ../schema/ build-files/
docker build --build-arg MYSQL_VERSION=5.7 -t hdbpp-mysql-innodb:latest .
[+] Building 3.2s (8/8) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 415B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/mysql/mysql-server:5.7 3.0s
=> [internal] load build context 0.0s
=> => transferring context: 2B 0.0s
=> CANCELED [1/4] FROM docker.io/mysql/mysql-server:5.7@sha256:1178cdd375f758968cd834ac4057bae41307e64b7c69a9e145896e7b11f48064 0.0s
=> => resolve docker.io/mysql/mysql-server:5.7@sha256:1178cdd375f758968cd834ac4057bae41307e64b7c69a9e145896e7b11f48064 0.0s
=> => sha256:1178cdd375f758968cd834ac4057bae41307e64b7c69a9e145896e7b11f48064 1.56kB / 1.56kB 0.0s
=> => sha256:a4ad24fe52cdf82a35c6f2dae7670cfebf39357de983cb909db07c8b56df4dd1 4.87kB / 4.87kB 0.0s
=> ERROR [2/4] COPY build-files/schema/hdb_innodb_schema.sql /docker-entrypoint-initdb.d/901_hdb_innodb_schema.sql 0.0s
=> ERROR [3/4] COPY build-files/schema/hdb_innodb_partition.sql /docker-entrypoint-initdb.d/902_hdb_innodb_partition.sql 0.0s
=> ERROR [4/4] COPY build-files/schema/hdb_innodb_user.sql /docker-entrypoint-initdb.d/903_hdb_innodb_user.sql 0.0s
------
> [2/4] COPY build-files/schema/hdb_innodb_schema.sql /docker-entrypoint-initdb.d/901_hdb_innodb_schema.sql:
------
------
> [3/4] COPY build-files/schema/hdb_innodb_partition.sql /docker-entrypoint-initdb.d/902_hdb_innodb_partition.sql:
------
------
> [4/4] COPY build-files/schema/hdb_innodb_user.sql /docker-entrypoint-initdb.d/903_hdb_innodb_user.sql:
------
Dockerfile:6
--------------------
4 | COPY build-files/schema/hdb_innodb_schema.sql /docker-entrypoint-initdb.d/901_hdb_innodb_schema.sql
5 | COPY build-files/schema/hdb_innodb_partition.sql /docker-entrypoint-initdb.d/902_hdb_innodb_partition.sql
6 | >>> COPY build-files/schema/hdb_innodb_user.sql /docker-entrypoint-initdb.d/903_hdb_innodb_user.sql
7 |
8 | USER root
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref moby::4gird04a0hvayo8qkgahjb0jb: "/build-files/schema/hdb_innodb_user.sql": not found
make: *** [build-files/.built] Error 1
The reason appears to be the trailing /
after the source path. Removing it allows the image to be built.
Edited by Thomas Juerges