Skip to content

Commit 294f6e5

Browse files
ChuckQuinnIVrobdimsdale
authored andcommitted
Add --no-index to ensure pip install is offline
1 parent 8b7a1f8 commit 294f6e5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pip_install_process.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (p PipInstallProcess) Execute(srcPath, targetLayerPath string) error {
3232

3333
err := p.executable.Execute(pexec.Execution{
3434
// Install pip from source with the pip that comes pre-installed with cpython
35-
Args: []string{"-m", "pip", "install", srcPath, "--user", fmt.Sprintf("--find-links=%s", srcPath)},
35+
Args: []string{"-m", "pip", "install", srcPath, "--user", "--no-index", fmt.Sprintf("--find-links=%s", srcPath)},
3636
// Set the PYTHONUSERBASE to ensure that pip is installed to the newly created target layer.
3737
Env: append(os.Environ(), fmt.Sprintf("PYTHONUSERBASE=%s", targetLayerPath)),
3838
Stdout: buffer,

pip_install_process_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func testPipInstallProcess(t *testing.T, context spec.G, it spec.S) {
4545
Expect(err).NotTo(HaveOccurred())
4646

4747
Expect(executable.ExecuteCall.Receives.Execution.Env).To(Equal(append(os.Environ(), fmt.Sprintf("PYTHONUSERBASE=%s", targetLayerPath))))
48-
Expect(executable.ExecuteCall.Receives.Execution.Args).To(Equal([]string{"-m", "pip", "install", srcLayerPath, "--user", fmt.Sprintf("--find-links=%s", srcLayerPath)}))
48+
Expect(executable.ExecuteCall.Receives.Execution.Args).To(Equal([]string{"-m", "pip", "install", srcLayerPath, "--user", "--no-index", fmt.Sprintf("--find-links=%s", srcLayerPath)}))
4949
})
5050
})
5151

0 commit comments

Comments
 (0)