-
-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3495 from telepresenceio/thallgren/cli-in-docker
Restore ability to run the telepresence CLI in a docker container.
- Loading branch information
Showing
4 changed files
with
55 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM telepresence | ||
|
||
RUN apk add --no-cache bash curl | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
package proc | ||
|
||
import "os" | ||
import ( | ||
"os" | ||
) | ||
|
||
var runningInContainer bool //nolint:gochecknoglobals // this is a constant | ||
|
||
func init() { | ||
_, err := os.Stat("/.dockerenv") | ||
runningInContainer = err == nil | ||
} | ||
|
||
// RunningInContainer returns true if the current process runs from inside a docker container. | ||
func RunningInContainer() bool { | ||
_, err := os.Stat("/.dockerenv") | ||
return err == nil | ||
return runningInContainer | ||
} |