Skip to content

Latest commit

 

History

History
127 lines (86 loc) · 2.62 KB

.verb.md

File metadata and controls

127 lines (86 loc) · 2.62 KB

{%=name%}

{%=description%}

CircleCI XO code style


Motivation

Just another "Hello World" docker image to be used in various experiments ...

Note: This Docker image is definitely not designed to be used in a production environment as it could result into serious security issues. But it's nice to be added to your toolbox when playing with Docker/Docker Swarm/Kubernetes, etc.

Usage

$ docker pull stefanwalther/{%=name%}
$ docker run -it -p 3000:3000 stefanwalther/{%=name%}

With docker-compose

version: '3.3`
services:
  hello-world:
    image: stefanwalther/{%=name%}
    ports:
      - 3000:3000
    environment:
      - PORT=3000
        

Configuration

  • PORT - Port of the web service, defaults to 3000.

Endpoints

/

Just returns a "Hello World":

{
  "text": "Hello World"
}

/health-check

Returns a typical health-check, useful to test health-checks in a microservice environment.

{
  "ts": "2017-12-07T22:25:34.489Z",
  "version": "0.3.1",
  "name": "docker-test",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/stefanwalther/docker-test.git"
  }
}

/cmd

Execute any command on the machine and get the result.

Parameters:

  • def - The command to execute.

Usage:

# Process ls -la
$ curl http://localhost:3000/cmd/?def=ls%20-la

Examples:

  • ls -la - list the directory
  • curl -o -I -L -s -w "%{http_code}\n" http://localhost:3000/health-check - Get the Http status code of the health-check

/cmd-cron

Create a cron job, executing a command.

Parameters:

Usage:

# Process "echo foo" with the following cron def: "* * * * *" (every minute)
$ curl http://localhost:3000/cmd-cron?def=echo%20foo&cron=*%20*%20*%20*%20*

Experiments

Multistage Builds

References:

About

Author

{%= docs('author.md') %}

Contributing

{%= docs('contributing.md') %}

License

{%= copyright() %}

{%= license %}