Docker File Error no such file or directory: unkno - docker

Trying to build a pkt miner image in order to deploy to akash.
Keep getting this error
Error invoking remote method 'docker-start-container':
Error: (HTTP code 400) unexpected -
OCI runtime create failed:
container_linux.go:367: starting container process caused: exec:
"./target/release/packetcrypt":
stat ./target/release/packetcrypt: no such file or directory: unknown```
My Dockerfile
FROM ubuntu:20.04
RUN apt-get update
RUN apt-get install -y \
build-essential \
curl
RUN apt-get update
RUN curl -y --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
RUN apt install make
RUN apt-get -y update
RUN apt-get -y install gcc git
RUN apt-get -y update
RUN git clone https://github.com/cjdelisle/packetcrypt_rs
ENV PATH=$PATH:/usr/local/packetcrypt_RS
CMD [ "~/", ".cargo/bin/cargo", "build", "--release" ]
CMD [ "./target/release/packetcrypt", "ann", "-p", "pkt1qd5skpmelkwvzy5vppqhafvmx0n5kqy97eglp00", "http://pool.pkteer.com" ]
I've tried adding WORKDIR
Can't seem to get rid of the error no matter what I do. I have a feeling im missing something obvious

Related

DOCKER "Error response from daemon: dockerfile parse error line 38: unknown instruction: ENTRYPOINT["/BIN/ENTRYPOINT.SH"]"

I'm new to docker and I'd like to understand the reason for this error, I'm creating a dockerfile where to start Elasticsearch, Mysql and the application, when I build it gives me this error "Error response from daemon: dockerfile parse error line 38: instruction unknown: ENTRYPOINT["/BIN/ENTRYPOINT.SH"]"
Dockerfile
FROM ubuntu:20.04
WORKDIR \\wsl.localhost\Ubuntu\home\marco\project\multiple-docker-container\backend
COPY . .
RUN apt update
RUN apt-get update
RUN apt-get install wget -y
RUN apt install apt-transport-https ca-certificates gnupg -y
RUN wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
RUN sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
RUN apt-get update -y
RUN apt-get install elasticsearch -y
RUN apt install mysql-server -y
RUN apt install npm -y
RUN npm install
RUN npm install nodemon
RUN apt install nodejs -y
EXPOSE 3306
EXPOSE 9200
EXPOSE 5000
COPY entrypoint.sh /bin/entrypoint.sh
RUN chmod +x /bin/entrypoint.sh
ENTRYPOINT ["/bin/entrypoint.sh"]
entrypoint.sh
#!/bin/sh
service elasticsearch start
service elasticsearch enable
service mysql start
npm start `
What could be the problem? I'm running this on an ubuntu terminal
In your question you wrote ENTRYPOINT["/BIN/ENTRYPOINT.SH"], in the Dockerfile I see ENTRYPOINT ["/BIN/ENTRYPOINT.SH"].
If your are talking about ENTRYPOINT["/BIN/ENTRYPOINT.SH"] the error is the missing space before the opening square bracket.
The previous answer is not very helpful.
I was getting the same error, but I wasn't missing a space and my error was not missing the space.
Turns out, there were newlines between directives in the Dockerfile.
So clearly spacing matters a little more than it should. 😉

Dockerfile uses "npm install" in a build step, but npm run in CMD fails

This is my Dockerfile
FROM debian:9
RUN apt-get update -yq \
&& apt-get install curl gnupg -yq \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash \
&& apt-get install nodejs -yq \
&& apt-get clean -y
ADD . /app/
WORKDIR /app
RUN npm install
EXPOSE 2368
VOLUME /app/logs
CMD ["npm", "run". "start"]
Now
docker build -t d_npm .
it compile with no errors
But
docker run -d -p 2368:2368 d_node
fails with this message
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "npm": executable file not found in $PATH: unknown.
How to fix this ?

executable file not found in $PATH: unknown

Trying to figure out why my dockerfile:
FROM mcr.microsoft.com/powershell:ubuntu-focal
RUN apt-get -qq -y update && \
apt-get -qq -y upgrade && \
apt-get -qq -y install curl ca-certificates python3-pip exiftool mkvtoolnix
RUN pip3 install gallery-dl yt-dlp
WORKDIR /mydir
COPY gallery-dl.ps1 .
ENTRYPOINT ["gallery-dl.ps1"]
throws the following error when run:
> docker build --file gallery-dl.dockerfile --tag psa .
> docker run -it --rm --name psatest psa
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "gallery-dl.ps1": executable file not found in $PATH: unknown.
I've tried seemingly everything: using CMD instead of ENTRYPOINT, modifying the COPY dest to ./gallery-dl.ps1, changing the order of commands.
I've prepended #!/usr/bin/pwsh -File to the ps1 script (as instructed in a different question of mine).
When I attach into the container and ls it shows all of my mounts and gallery-dl.ps itself where it should be and where I'm supposedly calling it:
PS /mydir> ls
conf gallery-dl.ps1 output
The only thing that works is removing WORKDIR but I actually need that, I can't just run everything in root.
Two things: Make sure the file is marked as executable. And since /mydir isn't in your path, you need to tell Docker to look for the script in the current directory by adding ./ in front of the name.
FROM mcr.microsoft.com/powershell:ubuntu-focal
RUN apt-get -qq -y update && \
apt-get -qq -y upgrade && \
apt-get -qq -y install curl ca-certificates python3-pip exiftool mkvtoolnix
RUN pip3 install gallery-dl yt-dlp
WORKDIR /mydir
COPY gallery-dl.ps1 .
RUN chmod +x gallery-dl.ps1
ENTRYPOINT ["./gallery-dl.ps1"]

Why am I getting Unable to correct problems, you have held broken packages

Trying to run Dockerfile and it fails at installing npm.
ERROR:
Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-get install -y npm' returned a non-zero code: 100
Dockerfile:
FROM ubuntu:14.04
MAINTAINER Giacomo Vacca "giacomo.vacca#gmail.com"
ENV REFRESHED_AT 2015-01-19
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get autoremove
RUN npm -v
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install --yes curl
RUN curl --silent --location http://deb.nodesource.com/setup_0.10 | sudo bash -
RUN apt-get install -y nodejs
RUN apt-get install --yes build-essential
RUN rm /usr/bin/node
# needs this to find the nodejs exec
RUN ln -s /usr/bin/nodejs /usr/bin/node
RUN apt-get install -y npm <--- FAIL
RUN /usr/bin/npm install socket.io#0.9.14
EXPOSE 8080
ENTRYPOINT ["/usr/bin/node", "/root/server.js"]
You don't need to install npm from the ubuntu distribution with:
RUN apt-get install -y npm
because it's already installed by the nodejs package from nodesource. You can check it with:
dpkg -L nodejs | grep "/usr/bin/npm"

Install kotlin in ubuntu image getting error

I am getting an error while installing kotlin in ubuntu image.
FROM ubuntu:16.04
RUN apt-get update
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get -qq -y install curl
RUN apt-get install -y unzip
RUN apt-get install -y zip
RUN curl -s https://get.sdkman.io | bash
RUN chmod a+x "$HOME/.sdkman/bin/sdkman-init.sh"
RUN source "$HOME/.sdkman/bin/sdkman-init.sh"
RUN sdk install kotlin
Getting error
Step 10/35 : RUN sdk install kotlin
---> Running in 9282af532681
/bin/sh: sdk: command not found
ERROR: Service 'myproject' failed to build: The command '/bin/sh -c sdk install kotlin' returned a non-zero code: 127
FROM ubuntu:16.04
RUN apt-get update
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get -qq -y install curl
RUN apt-get install -y unzip
RUN apt-get install -y zip
RUN curl -s https://get.sdkman.io | bash
RUN chmod a+x "$HOME/.sdkman/bin/sdkman-init.sh"
RUN source "$HOME/.sdkman/bin/sdkman-init.sh" && sdk install kotlin
Each RUN have their own "session". So RUN sdk install kotlin will not know about previous source command.
Multiple RUN is not optimal: each RUN will create a layer.
Looks like you want to create docker image with Kotlin JVM. Then you need standard openjdk:8-jdk (Or what version you want) and then just put there your jar file.

Resources