Skip to content

Instantly share code, notes, and snippets.

data_dir = "/opt/nomad/data"
bind_addr = "0.0.0.0"
datacenter = "DATACENTER"
advertise {
http = "$EXTERNAL_IP"
}
# Enable the client
client {
{
"job": {
"teapot": {
"datacenters": [
"DATACENTER"
],
"type": "service",
"group": {
"teapot": {
"task": {
class PersonSerializer(VersionnedSerializer):
name = serializers.CharField()
birthYear = serializers.CharField()
eyeColor = serializers.CharField()
gender = serializers.CharField()
hairColor = serializers.CharField()
height = serializers.IntegerField()
mass = serializers.IntegerField()
homeworld = HomeworldSerializer()
data_dir = "/var/lib/nomad"
bind_addr = "0.0.0.0" # the default
advertise {
# Defaults to the first private IP address.
http = "1.2.3.4"
rpc = "1.2.3.4"
serf = "1.2.3.4:5648" # non-default ports may be specified
}
@remilapeyre
remilapeyre / tp1.md
Created January 21, 2019 08:36
tp1.md

Lists

Write a function that remove duplicates from a list: for example:

[1, 3, 5, 3, 7, 3, 1, 1, 5]

should return

[1, 3, 5, 7]

TODO List

  1. Create a simple HTTP services that responds with Hello world to every requests:
const http = require('http')
const port = 3000

let test = []

Running & Inspecting Containers

By the end of this exercise, you should be able to:

  • Start a container
  • List running and stopped containers

Running Containers

  1. First, let’s start a container, and observe the output:
$ docker container run centos:7 echo "hello world"

Running & Inspecting Containers

By the end of this exercise, you should be able to:

  • Start a container
  • List running and stopped containers

Running Containers

  1. First, let’s start a container, and observe the output:
$ docker container run centos:7 echo "hello world"

Interactive Containers

Writing to Containers

  1. Create a container using the centos:7 image, and connect to its bash shell in interactive mode using the -i flag (also the -t flag, to request a TTY connection):
$ docker container run -it centos:7 bash

Detached Containers and Logging

Running a Container in the Background

  1. First try running a container as usual; the STDOUT and STDERR streams from whatever is PID 1 inside the container are directed to the terminal:
$ docker container run centos:7 ping 127.0.0.1 -c 2
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.