Code Monkey home page Code Monkey logo

Comments (19)

philaser avatar philaser commented on August 29, 2024 4

@Brescia717 unfortunately there has been no new release so you would still have to build the binaries on your M1 Mac.

I created this build step in the Dockerfile that needed to use Entrykit, essentially turning my Dockerfile into a multi-stage build

# pulls entrykit from master and builds 
FROM golang:1.17.1

RUN apt-get update && \
    apt-get install unzip -y

RUN wget https://github.com/progrium/entrykit/archive/refs/heads/master.zip \
    && echo testing the dir \
    && ls -a\
    && unzip master.zip \
    && rm master.zip \
    && cd entrykit-master/ \
    && make build \
    && mv build/Linux/entrykit /bin/entrykit

place this stage at the beginning of your Dockerfile and continue with your own Dockerfile stage:

FROM image

# This will copy the newly built Entrykit binaries to your docker file stage
COPY --from=0 /bin/entrykit /bin/entrykit
# This will run and create symlinks
RUN chmod +x /bin/entrykit \
    && entrykit --symlink

from entrykit.

philaser avatar philaser commented on August 29, 2024 2

Hi @joemcmahon, any instructions on how to build entrykit in the Dockerfile? Thanks a lot for your help

from entrykit.

philaser avatar philaser commented on August 29, 2024 2

After a few hours, I have found a nice way of extending an exisiting dockerfile to build entrykit without major modifications.

FROM golang:1.7.3
COPY path/to/entrykit/repo /entrykit
RUN cd /entrykit \
    && make build \
    && mv Linux/entrykit /bin/entrykit \
    && chmod +x /bin/entrykit \
    && entrykit --symlink

from entrykit.

joemcmahon avatar joemcmahon commented on August 29, 2024 1

Okay, here's what appears to be happening -- I did some searching on that exact error string: runtime: failed to create new OS thread (have 2 already; errno=22); it looks like this happens because the Docker image is trying to execute a binary not built for M1. You would hope for a better message, but that's what we get.

If you're using entrykit in your own Docker image, then the best thing to do is build entrykit itself in the Dockerfile, so that the binary is correct for your architecture. This isn't something I can tackle this evening (it's 10PM here) -- you can give it a shot if you like, and I'll carve out some time to work on it as soon as I can; worst case that will be Monday. This PR for nginx-proxy is a possible starting point for that: https://github.com/KWARC/nginx-proxy/blob/build-from-scratch/Dockerfile, and the entrykit Dockerfile probably should do the same.

And I will also see about creating a multi-architecture build as well; that may also be a possible fix. But the "build it in my Dockerfile" approach should definitely work. https://blog.jaimyn.dev/how-to-build-multi-architecture-docker-images-on-an-m1-mac/ tells how to do the multi-arch build, and I'll look at that on Monday as well.

from entrykit.

joemcmahon avatar joemcmahon commented on August 29, 2024 1

Yep, let's close it.

from entrykit.

joemcmahon avatar joemcmahon commented on August 29, 2024

from entrykit.

analyn-cajocson avatar analyn-cajocson commented on August 29, 2024

This doesn’t appear to be an entrykit bug specifically, but one related to the Go runtime. What is your current ulimit setting? You might try bumping it up and see if that fixes the issue. I do not have an M1 machine available, unfortunately, so we’ll have to try what we can to eliminate causes.

On Thu, Jun 17, 2021 at 11:09 PM Analyn Cajocson @.***> wrote: Hi, do you have any plan on supporting the Macbook M1? I'm getting this error on my machine: [image: image] https://user-images.githubusercontent.com/9253881/122514398-7f773280-d03e-11eb-9680-25d3ff841064.png Here's how we used entrykit in our Docker RUN wget https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSION}/entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \ && tar -xvzf entrykit_${ENTRYKIT_VERSION}Linux_x86_64.tgz \ && rm entrykit${ENTRYKIT_VERSION}_Linux_x86_64.tgz \ && mv entrykit /bin/entrykit \ && chmod +x /bin/entrykit \ && entrykit --symlink Thanks you! — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#16>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAO6G4YI3V6WHSIHQEJN7DTTLPIFANCNFSM465AIDIA .

Am I doing it right?

➜  ~ launchctl limit maxfiles
	maxfiles    65536          200000
➜  ~ ulimit -n
65536

I'm getting the same error...
Btw, thank you for your fast response.

from entrykit.

joemcmahon avatar joemcmahon commented on August 29, 2024

from entrykit.

analyn-cajocson avatar analyn-cajocson commented on August 29, 2024

Hmm, let me figure out how to build entrykit outside of Docker. I will get back to you once I'm done. Thank you!

from entrykit.

analyn-cajocson avatar analyn-cajocson commented on August 29, 2024

Hello, I tried running the same command on my M1 and got an error:

➜ entrykit --symlink
zsh: command not found: entrykit

I downloaded the entrykit_0.4.0_Darwin_x86_64.tgz and run the following command first:

➜  tar -xvzf entrykit_0.4.0_Darwin_x86_64.tgz
x entrykit
➜  chmod +x entrykit

from entrykit.

joemcmahon avatar joemcmahon commented on August 29, 2024

Right -- it would be looking for entrykit in your PATH rather than in the current directory. Does ./entrykit --symlink run?

from entrykit.

analyn-cajocson avatar analyn-cajocson commented on August 29, 2024

Right -- it would be looking for entrykit in your PATH rather than in the current directory. Does ./entrykit --symlink run?

oww ./entrykit --symlink works

from entrykit.

analyn-cajocson avatar analyn-cajocson commented on August 29, 2024

I tried to update the command on the Dockerfile:

ENV ENTRYKIT_VERSION 0.4.0

RUN wget https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSION}/entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
  && tar -xvzf entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
  && rm entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
  && mv entrykit /bin/entrykit \
  && chmod +x /bin/entrykit \
  && /bin/entrykit --symlink

And got an error:
image

from entrykit.

analyn-cajocson avatar analyn-cajocson commented on August 29, 2024

Hi @joemcmahon , thanks for the reference that you've sent. Let me look at it first then see what I can do.

from entrykit.

Brescia717 avatar Brescia717 commented on August 29, 2024

Any progress with this issue?

from entrykit.

joemcmahon avatar joemcmahon commented on August 29, 2024

@philaser, could you make a PR with this? I could just add it but I'd far rather you get the credit!

from entrykit.

Brescia717 avatar Brescia717 commented on August 29, 2024

@Brescia717 unfortunately there has been no new release so you would still have to build the binaries on your M1 Mac.

I created this build step in the Dockerfile that needed to use Entrykit, essentially turning my Dockerfile into a multi-stage build

# pulls entrykit from master and builds 
FROM golang:1.17.1

RUN apt-get update && \
    apt-get install unzip -y

RUN wget https://github.com/progrium/entrykit/archive/refs/heads/master.zip \
    && echo testing the dir \
    && ls -a\
    && unzip master.zip \
    && rm master.zip \
    && cd entrykit-master/ \
    && make build \
    && mv build/Linux/entrykit /bin/entrykit

place this stage at the beginning of your Dockerfile and continue with your own Dockerfile stage:

FROM image

# This will copy the newly built Entrykit binaries to your docker file stage
COPY --from=0 /bin/entrykit /bin/entrykit
# This will run and create symlinks
RUN chmod +x /bin/entrykit \
    && entrykit --symlink

Thanks for the help! Any chance you've tried using prehook? Running this in the Dockfile:

ENTRYPOINT [ \
  "prehook", "ruby -v", "--", \
  "prehook", "/myapp/backend/prehook", "--"]

yields this error:

Error response from daemon: failed to create shim task: 
OCI runtime create failed: runc create failed: 
unable to start container process: 
exec: "prehook": executable file not found in $PATH: unknown

NOTE: /myapp/backend is the directory the application is in in the docker container.

from entrykit.

joemcmahon avatar joemcmahon commented on August 29, 2024

@Brescia717 -- want to open the prehook problem as a separate issue? I'm going to put entrykit up on Hacktoberfest to motivate people to get a fix in if it's not fixed by then.

Edit: Never mind, got it for you.

from entrykit.

analyn-cajocson avatar analyn-cajocson commented on August 29, 2024

I think this issue was already resolved. Can we close this ticket now? 😅

from entrykit.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.