Skip to content

Instantly share code, notes, and snippets.

@jufemaiz
Last active July 23, 2021 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jufemaiz/a5512eb7f87a0f33f512b806dec49e5a to your computer and use it in GitHub Desktop.
Save jufemaiz/a5512eb7f87a0f33f512b806dec49e5a to your computer and use it in GitHub Desktop.
Makefile issues with golang using alpine 3.14
---
version: '3.8'
services:
package313:
build:
context: .
dockerfile: Dockerfile.313
container_name: wtf-313
volumes:
- ./:/app/
package314:
build:
context: .
dockerfile: Dockerfile.314
container_name: wtf-314
volumes:
- ./:/app/
FROM alpine:3.13
RUN apk add --no-cache make
COPY . /app
WORKDIR /app
RUN make path
FROM alpine:3.14
RUN apk add --no-cache make
COPY . /app
WORKDIR /app
RUN make path
.PHONY: path
default: path
path:
echo $$PATH
docker-compose build
Building package313
[+] Building 5.9s (10/10) FINISHED
=> [internal] load build definition from Dockerfile.313 0.0s
=> => transferring dockerfile: 145B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/alpine:3.13 1.4s
=> [internal] load build context 0.0s
=> => transferring context: 347B 0.0s
=> CACHED [1/5] FROM docker.io/library/alpine:3.13@sha256:f51ff2d96627690d62fee79e6eecd9fa87429a38142b5df8a3bfbb26061df7fc 0.0s
=> [2/5] RUN apk add --no-cache make 3.5s
=> [3/5] COPY . /app 0.1s
=> [4/5] WORKDIR /app 0.1s
=> [5/5] RUN make path 0.5s
=> exporting to image 0.1s
=> => exporting layers 0.1s
=> => writing image sha256:b99b1e551361e39e43b3e4555c05cfe50e887c5b7afe4b3316e083f99bcd42a3 0.0s
=> => naming to docker.io/library/alpine-issues_package313 0.0s
Successfully built b99b1e551361e39e43b3e4555c05cfe50e887c5b7afe4b3316e083f99bcd42a3
Building package314
[+] Building 4.1s (9/9) FINISHED
=> [internal] load build definition from Dockerfile.314 0.1s
=> => transferring dockerfile: 145B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/alpine:3.14 1.1s
=> CACHED [1/5] FROM docker.io/library/alpine:3.14@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 133B 0.0s
=> [2/5] RUN apk add --no-cache make 2.2s
=> [3/5] COPY . /app 0.1s
=> [4/5] WORKDIR /app 0.0s
=> ERROR [5/5] RUN make path 0.5s
------
> [5/5] RUN make path:
#9 0.435 make: /bin/sh: Operation not permitted
#9 0.435 make: *** [Makefile:5: path] Error 127
#9 0.435 echo $PATH
------
executor failed running [/bin/sh -c make path]: exit code: 2
ERROR: Service 'package314' failed to build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment