Closed medains closed 1 month ago
Ran into this issue as well on NixOS because the binary isn't fully statically linked.
Including my current shell.nix
to work around this in NixOS:
let
nixpkgs = import (
let
version = "5c7023e5f051e1f534c5bbac50f0d18320823b28";
in builtins.fetchTarball {
name = "nixpkgs-${version}";
url = "https://github.com/NixOS/nixpkgs/archive/${version}.tar.gz";
sha256 = "0v46qrjraamhxcf741z7k7fjpkgk2a3i3kjsa9q0jq18vcb2hwgn";
}
) {};
kernel = if nixpkgs.stdenv.isDarwin
then "darwin"
else "linux";
terraform-provider-teleport-version = "6.2.7";
terraform-provider-teleport =
nixpkgs.buildGoModule rec {
pname = "terraform-provider-teleport";
version = "${terraform-provider-teleport-version}";
src = nixpkgs.fetchFromGitHub {
owner = "gravitational";
repo = "teleport-plugins";
rev = "${pname}-v${version}";
sha256 = "12c39fgacslnsw6wqnywk2jz987icwvbr34zikrrj7m969iffrj1";
};
vendorSha256 = null;
modRoot = "terraform";
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp $GOPATH/bin/terraform $out/bin/terraform-provider-teleport
runHook postInstall
'';
};
in nixpkgs.mkShell {
nativeBuildInputs = with nixpkgs; [
bashInteractive
terraform_1_0_0
];
shellHook = ''
rm -rf $HOME/.terraform.d/plugins/gravitational.com/teleport/teleport
mkdir -p $HOME/.terraform.d/plugins/gravitational.com/teleport/teleport/${terraform-provider-teleport-version}/${kernel}_amd64
ln -s ${terraform-provider-teleport}/bin/terraform-provider-teleport $HOME/.terraform.d/plugins/gravitational.com/teleport/teleport/${terraform-provider-teleport-version}/${kernel}_amd64/terraform-provider-teleport
'';
}
CGO was disabled here https://github.com/gravitational/teleport-plugins/pull/491
Assuming you are using a recent version, the provider should now work in both alpine and NixOS environments
Description
What happened: Teleport Terraform provider does not work in default terraform docker image (aloine).
What you expected to happen: Teleport terraform provider to work in x86_64 environments, including docker images.
Reproduction Steps
As minimally and precisely as possible, describe step-by-step how to reproduce the problem.
With a simple main.tf
Actual Output
Resolution
Follow the pattern of most terraform provider plugins by statically linking libraries.
Workaround
Install libc6_compat in alpine environments
gz#3186