Add Dockerfile-go#1828
Conversation
955a76f to
2476631
Compare
anthony-gomez-fastly
left a comment
There was a problem hiding this comment.
TY for your contribution! LGTM, once @kpfleming reviews we can see about merging
kpfleming
left a comment
There was a problem hiding this comment.
I'm fine with this being merged as-is, but it (of course) suffers from the same issues that the others do. The example command for using the image is ... compute serve, which means that Viceroy will have to be downloaded and that sort of defeats the purpose of using a container image since it isn't self-contained and requires Internet access at runtime (and the Viceroy binary will have to be downloaded every time, unlike a local CLI installation where it will only be downloaded once).
If the CLI had some command which could be used to trigger the download of the ancillary binaries that could be used in the Dockerfile to avoid this problem... but it doesn't :-)
|
@kpfleming #1833 adds a |
) ### Change summary The container images (`Dockerfile-go`, `Dockerfile-node`, `Dockerfile-rust`) re-download Viceroy on each container start (raised in #1828 (review)), this PR adds an explicit `fastly compute install-viceroy` command that downloads and installs the Viceroy local-testing binary. #### Implementation Rather than duplicate the download logic, the existing installer was extracted out into a shared `viceroyInstaller` (`pkg/commands/compute/viceroy.go`). Both `compute serve` and the new command call it, so every version/override mechanism (the manifest's `[local_server] viceroy_version`, `FASTLY_VICEROY_USE_PATH`) applies identically during a pre-install. `ServeCommand.GetViceroy` is now a thin wrapper, so behavior is unchanged. This is intentionally simpler than #1805 (which embeds binaries into the CLI binary). All Submissions: * [x] Have you followed the guidelines in our Contributing document? * [x] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/fastly/cli/pulls) for the same update/change? ### New Feature Submissions: * [x] Does your submission pass tests? ### Changes to Core Features: * [x] Have you written new tests for your core changes, as applicable? * [x] Have you successfully run tests with your changes locally? ### User Impact A new `fastly compute install-viceroy` command lets users (and the container images) pre-install Viceroy ahead of time, so `compute serve` can start without needing to download it. No change to existing behavior - `compute serve` still installs Viceroy on demand if it isn't already present. ### Are there any considerations that need to be addressed for release? None. No breaking changes - the command is purely additive and the shared extraction keeps `compute serve`'s install path identical.
Change summary
Adds a
Dockerfile-goto the repo, mirroring the existingDockerfile-nodeandDockerfile-rustbut based on thegolang:latestimage. Like the others, this is a convenience Dockerfile that users can build to get a container with the Fastly CLI installed.Build/run usage is documented in comments at the bottom of the file:
All Submissions:
User Impact
Adds a Go-based Dockerfile option alongside the existing Node and Rust ones for users who prefer to build their own Fastly CLI container. No impact on existing functionality or users.
Are there any considerations that need to be addressed for release?
None. No breaking changes, and the image is not part of any build or release pipeline.