5151 CargoGitCacheVolume = fmt .Sprintf ("%s:%s" , filepath .ToSlash (gitPath ), ContainerCargoGitCache )
5252 BinPathVolume = fmt .Sprintf ("%s:%s" , filepath .ToSlash (binPath ), ContainerBinPath )
5353 //Volumes = []string{SourceCodeVolume, CargoRegistryCacheVolume, CargoGitCacheVolume, BinPathVolume}
54- Volumes = []string {SourceCodeVolume }
54+ Volumes = []string {SourceCodeVolume , BinPathVolume }
55+ PATH_ENV = ContainerBinPath + ":/root/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/osxcross/bin:/usr/bin/mingw-w64"
5556)
5657
5758var dockerClient * client.Client
@@ -75,12 +76,16 @@ func BuildBeacon(cli *client.Client, req *clientpb.Generate) error {
7576 timeout := 20 * time .Minute
7677 ctx , cancel := context .WithTimeout (context .Background (), timeout )
7778 defer cancel ()
79+
7880 buildBeaconCommand := fmt .Sprintf (
7981 "malefic-mutant generate beacon && malefic-mutant build malefic -t %s" ,
8082 req .Target ,
8183 )
8284 containerName := "malefic_" + cryptography .RandomString (8 )
8385 resp , err := cli .ContainerCreate (ctx , & container.Config {
86+ Env : []string {
87+ "PATH=" + PATH_ENV ,
88+ },
8489 Image : DefaultImage ,
8590 Cmd : []string {"sh" , "-c" , buildBeaconCommand },
8691 //"cargo run -p malefic-mutant stage0 professional x86_64 source && cargo build --release -p malefic-pulse"},
@@ -130,6 +135,9 @@ func BuildBind(cli *client.Client, req *clientpb.Generate) error {
130135 resp , err := cli .ContainerCreate (ctx , & container.Config {
131136 Image : DefaultImage ,
132137 Cmd : []string {"sh" , "-c" , BuildBindCommand },
138+ Env : []string {
139+ "PATH=" + PATH_ENV ,
140+ },
133141 }, & container.HostConfig {
134142 AutoRemove : true ,
135143 Binds : Volumes ,
@@ -181,6 +189,9 @@ func BuildPrelude(cli *client.Client, req *clientpb.Generate) error {
181189 resp , err := cli .ContainerCreate (ctx , & container.Config {
182190 Image : DefaultImage ,
183191 Cmd : []string {"sh" , "-c" , BuildPreludeCommand },
192+ Env : []string {
193+ "PATH=" + PATH_ENV ,
194+ },
184195 }, & container.HostConfig {
185196 AutoRemove : true ,
186197 Binds : Volumes ,
@@ -229,6 +240,9 @@ func BuildPulse(cli *client.Client, req *clientpb.Generate) error {
229240 resp , err := cli .ContainerCreate (ctx , & container.Config {
230241 Image : DefaultImage ,
231242 Cmd : []string {"sh" , "-c" , BuildBindCommand },
243+ Env : []string {
244+ "PATH=" + PATH_ENV ,
245+ },
232246 }, & container.HostConfig {
233247 AutoRemove : true ,
234248 Binds : Volumes ,
@@ -278,6 +292,9 @@ func BuildModules(cli *client.Client, req *clientpb.Generate) error {
278292 resp , err := cli .ContainerCreate (ctx , & container.Config {
279293 Image : DefaultImage ,
280294 Cmd : []string {"sh" , "-c" , buildModulesCommand },
295+ Env : []string {
296+ "PATH=" + PATH_ENV ,
297+ },
281298 }, & container.HostConfig {
282299 AutoRemove : true ,
283300 Binds : Volumes ,
0 commit comments