Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

permission denied when running image build locally #1050

Closed
1 of 5 tasks
ranefattesingh opened this issue Jun 25, 2024 · 1 comment
Closed
1 of 5 tasks

permission denied when running image build locally #1050

ranefattesingh opened this issue Jun 25, 2024 · 1 comment

Comments

@ranefattesingh
Copy link

ranefattesingh commented Jun 25, 2024

Description

I was running my Go project for doing integration test but everytime I run the image I am getting the permission denied error.

/bin/sh: 1: /bin/: Permission denied

Version

colima version 0.6.9
git commit: https://github.com/abiosoft/colima/commit/c3a31ed05f5fab8b2cdbae835198e8fb1717fd0f

runtime: docker
arch: aarch64
client: v26.1.4
server: v26.1.1

Operating System

  • macOS Intel <= 13 (Ventura)
  • macOS Intel >= 14 (Sonoma)
  • Apple Silicon <= 13 (Ventura)
  • Apple Silicon >= 14 (Sonoma)
  • Linux

Output of colima status

INFO[0000] colima is running using QEMU
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: 9p
INFO[0000] socket: unix:https:///Users/uname/.colima/default/docker.sock

Reproduction Steps

  1. docker build -t apitest
  2. docker run apitest OR docker run apitest:latest
  3. /bin/sh: 1: /bin/: Permission denied

Expected behaviour

docker run apitest should start container

Additional context

dockerfile used when building image

FROM golang:1.21.6-bookworm AS build

ARG app_name=myapp

RUN mkdir /app

ADD . /app

WORKDIR /app

ENV CGO_ENABLED=1

RUN go build -mod=vendor -buildvcs=true -ldflags '-linkmode=external' -o $app_name ./cmd/$app_name/

FROM golang:1.21.6-bookworm

ARG app_name=myapp

ENV APP_NAME=$app_name

COPY --from=build /app/$app_name /bin/$app_name

RUN chmod +x /bin/$app_name

EXPOSE 8080

ENTRYPOINT /bin/$app_name
@ranefattesingh
Copy link
Author

found fix, it was due to entrypoint of the image hence closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant