-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
🐛 Bug Report: Unable to build and deploy Backstage using provided documentation #27503
Comments
Hi @cliffAtOsaic, sorry to hear you are having issues, does it work when you run it exactly as the documentation shows - What is |
No, it doesn't work when I run it exactly as the documentation shows either. The env.sh contains our secrets so there isn't much I can share. It contains environment variables that are read in app-config.yaml. The only change I made was to the Dockerfile to copy my env.sh into the image. When I run without the env-file parameter, it throws because it can't find the path to the https certificate:
|
Thanks for the follow up @cliffAtOsaic, this is odd as this works for me. I've been helping a few people with different issues around this subject with no clear insight into why it works for me and in our CI but people like yourself are having issues. There are the steps I take:
Is that exactly what you did? |
Hi @awanlin, yes, that's exactly what I did originally, only I had to add
What I find strange is that I get a Node.js command prompt with no output. |
Agree, it's very odd. I get this as my initial output based on the steps I posted:
Can you share your full Dockerfile so I can try it locally, please? |
Yes, thank you, please see below. Reading through it, I also changed some directories from
|
I may have discovered something interesting. I did some reading and it seems like Docker is exiting early because the Backstage app is exiting early. When the container starts, the command under CMD gets executed. I decided to execute it outside of docker and here's what happened:
This runs normally using |
This appears to be a repro of #24808 |
The Docker command:
Is running the compiled code, the results of running - Where as |
I compiled the code with |
When you run The Dockerfile command is correct and it's working for myself and others. What we need to figure out is what's the difference in your environment and mine. I'm running on macOS but you are on Linux 6.8.0-45-generic - linux/x64, could there be something there that we need to take into account? Are you using WSL? I haven't had time to try out your Dockerfile yet, it's been a very busy week as I'm heading off to BackstageCon/KubeCon next week. I very much would like to though. |
The problem with running in Docker is I get no output. Let my try extracting the files like it does in the Dockerfile and see if I can get the 'node' command to run locally. I.e., I want to get a repro outside of Docker so I can see why Docker appears to be no-op. I'm running |
Not sure if this is relevant, but I got his error after extracting the skeleton.tar.gz package and running the yarn workspace command:
Could the issue be that Corepack is missing from the Dockerfile install? Are you using Yarn 1.x or Yarn 4.x? |
Replacing After extracting the skeleton tarball and getting running
When I look at
|
@cliffAtOsaic the skeleton tarball is just the package.json file so that makes sense. It’s the bundle that contains the actual files. Take it back to first principles and do the build without Docker:
That should have the dist folder and index.cjs.js files that you expect. |
@awanlin I am updating yarn 1 to yarn 4. I am getting this issue. As mention in Dockerfile. if i use followings. backstage/packages/backend/Dockerfile Line 51 in 0d5d421
i am getting this error becuase of dev dependencies.
It seems to me '--production' only download prodcution dependencies. so how should we mange this for production. curently i am using following commands on production.
|
@lalit774 you would normally run
|
Thanks for helping out @darylgraham, I'm going to leave this with you 👍 |
So why does the Dockerfile only copy the skeleton and not the bundle? |
Never mind me, I see it copies the bundle tarball a little later in the Dockerfile. I extracted
I confirmed that it is listed in package.json:
I ran I then tried |
it seems you have |
📜 Description
I have created and configured a Backstage application which builds and runs with
yarn start-backend
andyarn start
.I am now attempting to deploy our Backstage app to a QA server. The documentation recommends using docker for this. I have followed the steps at https://backstage.io/docs/deployment/docker to build the app with yarn and build the image with Docker.
👍 Expected behavior
When I execute the command
docker run -it -p 7007:7007 backstage --env-file env.sh
I expect the app to run in a Docker container on port 7007.👎 Actual Behavior with Screenshots
When I run the docker app, I get a Node.js command prompt. I cannot access the website using port 7007 (or any port).
👟 Reproduction steps
Follow the instructions at https://backstage.io/docs/deployment/docker
📃 Provide the context for the Bug.
I am unable to deploy the app using Docker containers.
🖥️ Your Environment
The text was updated successfully, but these errors were encountered: