Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Write a Dockerfile that can build both `entropy` and `server`. This commit satisfies the pre-requisite for building container images from the source code herein inside a CI/CD pipeline (or, really, for any other purpose we might need containers for), as described in #423. The long and short of it is that we can use this to have container images built of the current commit, or any commit that we want. Since the code here depends on access to currently-private GitHub repositories, we need to have set a GitHub Personal Access Token (PAT) that can access the `entropyxyz/synedrion` and `entropyxyz/constraints` repositories. This is expected to be part of the `entropy-workstation-setup` [prerequisites](https://github.com/entropyxyz/entropy-workstation-setup#pre-requisites), so do that first if you haven't yet. The canonical place for such a token on a developer machine is `~/.entropy.auth.sh`, so developers can create containers of the `entropy` binary in a manner like so from their local workstation: ```shell docker buildx build \ --secret id=credentials,src=$HOME/.entropy.auth.sh \ --tag entropy . ``` This assumes a line like the following exists in `~/.entropy.auth.sh`: ```shell export GITHUB_TOKEN="ghp_xxxxxxxxxx" # Obviously, put a real PAT here. ``` You can also build arbitrary packages in the same environment by setting the `PACKAGE` build argument: ```shell docker buildx build --build-arg PACKAGE=server \ --secret id=credentials,src=$HOME/.entropy.auth.sh \ --tag server . ``` Additional build arguments provide some flexibility for the build environment: `RUST_VERSION`, `DEBIAN_CODENAME`, and `ALPINE_VERSION`. * Add clarifying comment on multi-stage builds. Co-authored-by: Hernando Castano <[email protected]> --------- Co-authored-by: Hernando Castano <[email protected]>
- Loading branch information