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.

I can build locally but not within Docker

See original GitHub issue

Hello all,

The time for deploying my first app version has arrived and I am trying to build successfully in production mode. If I run npm run build:production everything goes well and I see sentry plugin working ok (I do not get any build errors).

However, if I want to build a Docker image with the production stuff running this:

DOCKER_BUILDKIT=1 docker build -f ./config/Dockerfile --target=production -t kindoiserver:production .

Then first I get the following error: #15 11.13 ERROR in Sentry CLI Plugin: Unable to determine version. Make sure to includereleaseoption or use the environment that supports auto-detection https://docs.sentry.io/cli/releases/#creating-releases #15 11.16 npm ERR! code ELIFECYCLE Which I solve adding the release field as follows:

    new SentryWebpackPlugin({
      include: outputPath,
      configFile: path.resolve(configPath, 'sentryConfig.properties'),
      ignore: ['node_modules', 'config', '.vscode', 'logs', 'assets'],
      release: process.env.npm_package_version
    }),

Then after this I get this other error:

ERROR in Sentry CLI Plugin: Command failed: /opt/app/server/node_modules/@sentry/cli/sentry-cli releases new 1.0.0 #15 10.83 INFO 2020-09-25 16:04:45.668584209 +00:00 sentry-cli was invoked with the following command line: "/opt/app/server/node_modules/@sentry/cli/sentry-cli" "releases" "new" "1.0.0" #15 10.83 error: API request failed #15 10.83 caused by: [60] SSL peer certificate or SSH remote key was not OK

Why do I not need the release field when building locally in my machine without Docker? What about that SSL? Is this the expected behavior?

Thank you in advance and regards.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
javierguzmancommented, Oct 10, 2020

Just in case is useful for someone in future I did not know node Docker image was based on Debian so I have got rid of the SSL error doing this within the image build:

RUN apt-get update && apt-get install -y ca-certificates

For the release error one I have ended up playing around with some environment variables rather than relying on Git. I do not fancy copying over the Git folder to the Docker image.

I close this @kamilogorek. Thanks for your help!

1reaction
kamilogorekcommented, Oct 5, 2020

Why do I not need the release field when building locally in my machine without Docker?

I don’t know what image or what your Dockerfile configuration is, but it’s usually caused by .git directory, or git command itself not being accessible. We are doing a release proposal based on the VCS that the project uses.

What about that SSL? Is this the expected behavior?

It’s definitely not, however it’s most likely caused by the docker image missing certificates configuration. You can verify this by disabling ssl for sentry-cli using configFile option in webpack plugin in conjunction with verify_ssl config - https://docs.sentry.io/product/cli/configuration/

[http]
verify_ssl=false
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can a Docker image build locally, but not at remote ...
It appears that this issue is due to usage of the docker overlay storage backend. I've raised a bug for it here: ...
Read more >
Running your build locally in Docker - Bitrise Docs
You can run a Bitrise build in Docker on your own machines: you need Docker, the Bitrise CLI, and a Bitrise Docker image....
Read more >
docker build - Docker Documentation
The docker build command builds Docker images from a Dockerfile and a “context”. A build's context is the set of files located in...
Read more >
The same Docker image and code line work locally but fails ...
My Groovy application inside Docker is failing with NoSuchMethodError: org.codehaus.groovy.runtime.DefaultGroovyMethods.
Read more >
Build and Run a Node.js application in Docker - Bits and Pieces
Adding the node modules in the image from the local is not recommended. Some packages are OS specific (node-sass for example) and as...
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