faint-painting-38451
10/07/2021, 1:23 PMCOMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -p datahub build
but I keep getting the error UNABLE_TO_GET_ISSUER_CERT_LOCALLY
when it tries to build the datahub-frontend container. I tried changing the registry to the proxy that we need to use at my company through .npmrc
and .yarnrc
files, but I am still seeing <https://registry.npmjs.org/yarn>
in the error log. How can I change that to my proxy so that it will build?big-carpet-38439
10/07/2021, 4:29 PMloud-island-88694
some-glass-26087
10/07/2021, 7:51 PMnpm/yarn
(and lots of other tools) by default don't want to talk to talk to sites with self-signed certs. And anything building inside of docker wouldn't have the same company certs that you likely have on your machine.
So you change the registry url, but npm is not liking it.
A few ways to address:
1
You can see in the link from John above that you can tell npm to not be strict about bad ssl. I'm not a fan of this. I'm also not a fan of self-signed certs -- with LetsEncrypt and other options, cost usually isn't a barrier any longer but lots of IT teams aren't up to speed on those.
So even though I'm not a fan of this, you can try setting strict-ssl=false
in .npmrc and .yarnrc since you said you're already editing those files and rebuilding. There's also a way to feed that in via the build.gradle file but I'm not familiar enough with gradle to quite know where to put that (but would be happy to try and figure it out with you).
2
You can ask your IT org if you can have the CA bundle and cert info for that internal proxy/registry. Then we can figure out how to pass it / include it with the npm/yarn calls. This is what I've had to do several times to get around internal self-signed certs (though that's for python projects but I'm sure we can figure it out with npm/yarn as well).
3
You can ask your IT org to get with the program and put a real SSL cert on that device as I'm surprised it hasn't caused more issues honestly.
4
If you don't know if any of the above is true or not, ask a bit and come back with some more info if my assumptions were incorrect and that proxy/registry does have a legit cert. We may have to think about this in a different way. If so, maybe I can throw together some sort of test or experiment to help narrow down what the cause is.some-glass-26087
10/07/2021, 10:37 PMsome-glass-26087
10/07/2021, 10:40 PMastonishing-lunch-91223
10/08/2021, 2:09 AMdoFirst
block for tasks.yarnSetup
instead of tasks.npmSetup
. Also, adding this tasks.yarnSetup
block to the root build.gradle file doesn't work since it can't find the yarnSetup task there, which I guess is because it has to happen in the file where apply plugin: 'com.github.node-gradle.node'
is called so I managed to make it work by adding this tasks.yarnSetup
block to datahub-web-react/build.gradle
. I'd hate to have to maintain a patched version of this file internally, so would you be able to propose a better way of configuring this without having to change any code? Adjusting it via an environment variable would be great.some-glass-26087
10/08/2021, 1:56 PMastonishing-lunch-91223
10/08/2021, 7:44 PM