Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shamsher31/goisdocker
Check if the process is running inside a Docker container
https://github.com/shamsher31/goisdocker
docker golang package
Last synced: 4 days ago
JSON representation
Check if the process is running inside a Docker container
- Host: GitHub
- URL: https://github.com/shamsher31/goisdocker
- Owner: shamsher31
- License: mit
- Created: 2015-08-16T16:46:59.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-28T05:07:36.000Z (over 8 years ago)
- Last Synced: 2024-06-21T03:17:22.800Z (5 months ago)
- Topics: docker, golang, package
- Language: Go
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# goisdocker
[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/shamsher31/goisdocker)
[![Build Status](https://travis-ci.org/shamsher31/goisdocker.svg)](https://travis-ci.org/shamsher31/goisdocker)
[![GitHub release](http://img.shields.io/github/release/shamsher31/goisdocker.svg?style=flat-square)](release)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](license)Check if the process is running inside a Docker container
### How to install
```go
go get github.com/shamsher31/goisdocker
```### How to use
```go
package mainimport (
"fmt"
"github.com/shamsher31/goisdocker"
)func main() {
if(docker.Is()) {
fmt.Println("Running inside a Docker container")
}
}
```
###Aliasing Imports
If you already have package name ```docker``` you can use following.
```go
package mainimport (
"fmt"
pckDocker "github.com/shamsher31/goisdocker"
)func main() {
if(pckDocker.Is()) {
fmt.Println("Running inside a Docker container")
}
}
```### Related
[goisvdo](https://github.com/shamsher31/goisvdo)
[goistext](https://github.com/shamsher31/goistext)
[goisimg](https://github.com/shamsher31/goisimg)### Why
This package is inspired by [is-docker](https://www.npmjs.com/package/is-docker) npm module.### License
MIT © [Shamsher Ansari](https://github.com/shamsher31)