Rework building of Docker images#1382
Conversation
dcroote
left a comment
There was a problem hiding this comment.
I did a few quick tests of the dockerhub -dev images for this commit (d0a04df8fdbbdca4b14548256422c0f7d075cf03) and they appeared to be functional 👍
| This is a Docker container for building all the packages in the monorepo and providing their build artifacts. Other | ||
| package specific containers can use this one to obtain files necessary for their run without building or installing any | ||
| additional dependencies. | ||
| This is a Docker container for building all the packages in the monorepo, publishing the NPM packages (TODO) and |
There was a problem hiding this comment.
| This is a Docker container for building all the packages in the monorepo, publishing the NPM packages (TODO) and | |
| This is a Docker container for building all the packages in the monorepo, publishing the NPM packages (TODO) and |
These TODOs have a tendency to be forgotten, so I'd just avoid them and mention NPM publishing when implemented. Doesn't matter much to me though.
| ```bash | ||
| docker build --build-arg build=local -f docker/Dockerfile -t api3/airnode-artifacts:latest . | ||
| # or with no build argument | ||
| ... -v /var/run/docker.sock:/var/run/docker.sock ... |
There was a problem hiding this comment.
This is cross platform right?
There was a problem hiding this comment.
Feel free to test it on Mac, it should work there. Not sure about Windows but I don't think being able to build the images there is as important as being able to run them there.
There was a problem hiding this comment.
Yeah, will try to test this today.
There was a problem hiding this comment.
Can we mention (or create an issue) that this is unusable on macOS due to docker copy being unusably slow?
There was a problem hiding this comment.
I've changed the way the files are copied (as we've discussed on Slack). Can you test it again?
There was a problem hiding this comment.
Sorry that it took so long. I can confirm this works, but I had to add back some missing dependencies.
I have also a bit cleaner suggestion for copying the files. Essentially you can do a git clone from a local repo. See: 47ddc74
0c4b5e6 to
15f9565
Compare
Siegrift
left a comment
There was a problem hiding this comment.
There is https://github.com/api3dao/airnode/blob/docker-image-from-released-packages/packages/airnode-examples/src/scripts/rebuild-deployer-container.ts and similar ones for artifacts and client. These are no longer used in the examples and can be removed from package.json (and the test one).
15f9565 to
c9852f4
Compare
Siegrift
left a comment
There was a problem hiding this comment.
Tested on macOS, left a minor suggestion, but 👍 LGTM.
One thing that threw me off a bit is that the images are tagged as :local by default (previously we used :latest) but I've checked the airnode repo and docs and there are no references to :latest.
| ```bash | ||
| docker build --build-arg build=local -f docker/Dockerfile -t api3/airnode-artifacts:latest . | ||
| # or with no build argument | ||
| ... -v /var/run/docker.sock:/var/run/docker.sock ... |
There was a problem hiding this comment.
Sorry that it took so long. I can confirm this works, but I had to add back some missing dependencies.
I have also a bit cleaner suggestion for copying the files. Essentially you can do a git clone from a local repo. See: 47ddc74
c9852f4 to
c4537d3
Compare
|
@Siegrift I've added the dependencies and changed the file copying to follow the |
c4537d3 to
72e41f7
Compare
Close #1331
Should be pretty much the final version as far as the Docker containers go but it will be expanded on in #1332 and #1333 so we can publish NPM packages even without building the Docker images.