Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 main

import (
"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 main

import (
"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)