@@ -200,9 +200,8 @@ func (o *OctopusContainerTest) setupOctopus(ctx context.Context, connString stri
200
200
Image : o .getOctopusImageUrl () + ":" + o .getOctopusVersion (),
201
201
ExposedPorts : []string {"8080/tcp" },
202
202
Env : map [string ]string {
203
- "ACCEPT_EULA" : "Y" ,
204
- "DB_CONNECTION_STRING" : connString ,
205
- // CONNSTRING, LICENSE_BASE64, and CREATE_DB are used by the octopusdeploy/linux image
203
+ "ACCEPT_EULA" : "Y" ,
204
+ "DB_CONNECTION_STRING" : connString ,
206
205
"CONNSTRING" : connString ,
207
206
"CREATE_DB" : "Y" ,
208
207
"ADMIN_API_KEY" : getApiKey (),
@@ -212,17 +211,26 @@ func (o *OctopusContainerTest) setupOctopus(ctx context.Context, connString stri
212
211
"OCTOPUS_SERVER_BASE64_LICENSE" : os .Getenv ("LICENSE" ),
213
212
"LICENSE_BASE64" : os .Getenv ("LICENSE" ),
214
213
"ENABLE_USAGE" : "N" ,
214
+ "PATH" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ,
215
215
},
216
216
Privileged : disableDind != "Y" ,
217
217
WaitingFor : wait .ForLog ("Listening for HTTP requests on" ).WithStartupTimeout (30 * time .Minute ),
218
218
Networks : []string {
219
219
network ,
220
220
},
221
- Cmd : []string {
222
- "/bin/sh" ,
221
+ // Instead of using Cmd for installation, use an EntryPoint script
222
+ Entrypoint : []string {
223
+ "/bin/bash" ,
223
224
"-c" ,
224
- "wget -O - https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && echo \" deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main\" | tee /etc/apt/sources.list.d/hashicorp.list && apt update -y && apt install terraform -y" ,
225
- }}
225
+ "apt-get update && apt-get install -y curl gnupg lsb-release && " +
226
+ "curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && " +
227
+ "echo \" deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main\" | tee /etc/apt/sources.list.d/hashicorp.list > /dev/null && " +
228
+ "apt-get update && apt-get install -y terraform && " +
229
+ "which terraform && " + // Verify where terraform is installed
230
+ "terraform --version && " + // Verify terraform is working
231
+ "/usr/local/bin/octopus.server.sh" , // Start the Octopus server process
232
+ },
233
+ }
226
234
227
235
req .Env = o .AddCustomEnvironment (req .Env )
228
236
0 commit comments