edgexfoundry / security-api-gateway

Owner: Security WG
Apache License 2.0
11 stars 10 forks source link

docker Makefile target should depend on build target #72

Open anonymouse64 opened 5 years ago

anonymouse64 commented 5 years ago

The Makefile currently builds the docker container by copying an already built edgexproxy binary into the container, however the target doesn't depend on the build target which actually builds the edgexproxy binary. See for example, in a fresh clone of the repo:

$ make docker
docker build \
         --no-cache=true --rm=true \
                --label "git_sha=a37fb94749e9880435b6bacf327682c00edaaa86" \
                        -t edgexfoundry/docker-edgex-proxy-go:a37fb94749e9880435b6bacf327682c00edaaa86 \
                        -t edgexfoundry/docker-edgex-proxy-go:1.0.0-dev \
                        -t edgexfoundry/docker-edgex-proxy-go:latest \
                        .
Sending build context to Docker daemon  28.86MB
Step 1/8 : FROM alpine:3.7
 ---> 6d1ef012b567
Step 2/8 : RUN mkdir -p /edgex/res
 ---> Running in 3b08f01aa2b1
Removing intermediate container 3b08f01aa2b1
 ---> fb8eee009da2
Step 3/8 : WORKDIR /edgex
 ---> Running in 89cedb96075f
Removing intermediate container 89cedb96075f
 ---> 3014b6581bce
Step 4/8 : COPY core/res/configuration-docker.toml res/configuration.toml
 ---> 802f55db2d7e
Step 5/8 : ADD core/edgexproxy .
ADD failed: stat /var/snap/docker/common/var-lib-docker/tmp/docker-builder452809909/core/edgexproxy: no such file or directory
Makefile:29: recipe for target 'docker_edgexproxy' failed
make: *** [docker_edgexproxy] Error 1
anonymouse64 commented 5 years ago

Note that since this service is being migrated to edgex-go, this issue will be solved when https://github.com/edgexfoundry/edgex-go/pull/1537 is merged there. I will close this when that's merged