question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot Build Docker - Latest Version

See original GitHub issue
  • Version (cloudcmd -v):
  • Node Version node -v:
  • OS (uname -a on Linux):
  • Browser name/version:
  • Used Command Line Parameters:
  • Changed Config:

Hi,

I cloning Cloudcmd in order to make the css edits, per issue https://github.com/coderaiser/cloudcmd/discussions/361.

I am trying to build a new Docker Hub repo with my edits but I am having problems. I have tried both the standard Dockerfile and the Dockerfile-alpine.

FIRST ATTEMPT: In my terminal, I cd to the “docker” folder and I run: docker build --no-cache -t cloudcommander .

I get the below error message: failed to compute cache key: "/package.json" not found: not found

So I copied package.json to to the “docker” folder and ran docker build again. I get a bunch of npm deprecated warnings; and the build completes without errors.

I then go to terminal and I type: docker run -dp 8000 cloudcommander I get the below error: docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/usr/src/app/bin/cloudcmd.mjs": stat /usr/src/app/bin/cloudcmd.mjs: no such file or directory: unknown.

No luck so I try the Second Attempt

SECOND ATTEMPT: I copy the Dockerfile to the root of the repo. I then cd to the root of the repo and run the docker build command.

The build finishes without errors. Then I run: docker run -dp 8000 cloudcommander

The container then appears in Docker Desktop, but turned off. When I click on the docker it shows this as the error: /usr/bin/env: 'node\r': No such file or directory

THIRD ATTEMPT Next I renamed the Dockerfile.alpine to Dockerfile and copied to the root of the repo. I ran the docker build and docker run without errors. On Docker Desktop I get the same error above.

I tried the same with the Alpine Dockerfile in the /docker folder and when going to Docker Desktop, I get this error message: Error invoking remote method 'docker-start-container': Error: (HTTP code 400) unexpected - OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/usr/src/app/bin/cloudcmd.mjs": stat /usr/src/app/bin/cloudcmd.mjs: no such file or directory: unknown

I am not sure what I am doing wrong to build the docker.

Any advise?

Thank you.

H.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
hernanditocommented, Jan 18, 2022

@coderaiser and @timoknapp this worked like a charm guys. Thank you for all the help. I will be adding some comments to a previous thread in Discussion.

Thanks again.

2reactions
timoknappcommented, Jan 18, 2022

Hi @hernandito ,

Before building the Docker images, you have to build the project at first. In order to do this you need to execute the following commands:

# All commands need to executed from the root of the repository.
git@github.com:coderaiser/cloudcmd.git
cd cloudcmd
...

# Install NPM packages
npm i redrun -g
npm install

# Build the artifact
redrun build

# Do ONE of the following:

# 1. Build the Docker images for multiple CPU Architecture
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64 --file docker/Dockerfile .
# This build an alpine based image
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64 --file docker/Dockerfile.alpine .

2. Build the Docker image only for the local environment
docker build --file docker/Dockerfile .
# This build an alpine based image
docker build --file docker/Dockerfile.alpine .

I hope this helps you out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker build - Docker Documentation
docker build returns a no such file or directory error if the file or directory does not exist in the uploaded context. This...
Read more >
docker - Can't build Dockerfile - Stack Overflow
I'm running docker [Docker 18.06.1-ce, build e68fc7a] on an Ubuntu 18 ... 'can't stat '/home/aielloine/.docker/helloapp/dockerfiles''.
Read more >
docker build exits successfully but no built image show up in ...
Successfully build builds image and exits successfully, but the image named "manjeet28/catnip:latest" does not show up in the docker images ...
Read more >
Why new Macs break your Docker build, and how to fix it
Solution #2: Run x86_64 Docker images instead​​ The other option is to run x86_64 Docker images on your ARM64 Mac machine, using emulation....
Read more >
SOLVED: Docker build “Could not resolve 'archive.ubuntu ...
I was configuring Apache server using an ubuntu:latest image and during the process, i encountered an unusual error where i couldn't apt-get anything...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found