Closed NakanishiKM closed 3 months ago
It's recommended for you to create a Rocker Extension to support passing that through during the build stages.
There's a base class for the extension: https://github.com/osrf/rocker/blob/4078d223a2158e9a6fea31d8871dc7df7ee094f0/src/rocker/core.py#L61 And then you need to register it via setup.py
You can find some built in extensions in rocker (such as here https://github.com/osrf/rocker/blob/main/src/rocker/extensions.py) as well as several 3rdparty ones linked from the readme.
You can make your own package or open a PR back here if you think that it's generic enough. A build-argument extension I think would be useful.
Note that for this specifically you may want to consider using the docker config which looks like it can inject the proxy elements for you without the need for an ARG: https://docs.docker.com/network/proxy/#configure-the-docker-client
Thank you for response!
okay, I understood your suggestion and decided that it would be possible to extend the build-argument using that class.
However, if an individual user has configured ./docker/config.json
, it can pass the proxy there, so don't concern about the difficulties and just refer to own personal configuration file.
Thank you for your consultation!
You're welcome, I think because the config option exists with native support from docker and can support both build and run time without an issue that I will suggest that it be the recommended approach and keep the implementation in rocker simpler and avoid that element of complexity.
Hi, When executing the command in a proxy environment, the following error was displayed. I felt that this error occurred when I could not connect to the external network.
When creating a docker image, I used the option
---build-arg http_proxy=<http://proxy:port>
to connect to the network, but how should I do this with the commandrocker
?