docker exec -it $(docker ps -q) bash
docker run -it ubunut bash
docker kill $(docker ps -q)
Delete all stopped containers with
| import http.server | |
| import socketserver | |
| from http import HTTPStatus | |
| class Handler(http.server.SimpleHTTPRequestHandler): | |
| def do_GET(self): | |
| self.send_response(HTTPStatus.OK) | |
| self.end_headers() | |
| self.wfile.write(b'Hello world') |
| { | |
| "name": "some-name", | |
| "version": "0.0.1", | |
| "dependencies": { | |
| } | |
| } |
| export DOCKER_BUILDKIT=1 | |
| GPC_PROJECT_ID=hkraft-iot | |
| SERVICE_NAME=defibrilator-registry | |
| CONTAINER_NAME=europe-west1-docker.pkg.dev/$(GPC_PROJECT_ID)/cloud-run/$(SERVICE_NAME) | |
| .PHONY: * | |
| run: build | |
| docker run -it -p 8080:8080\ | |
| -e CLIENT_ID=$$(gopass hjertestarterregisteret.no/client-id)\ |
| FROM golang:1-alpine as builder | |
| RUN apk update | |
| RUN apk add --no-cache ca-certificates git | |
| WORKDIR /app | |
| # Fetch dependencies first; they are less susceptible to change on every build | |
| # and will therefore be cached for speeding up the next build. | |
| COPY go.* . |
curl -s -L https://github.com/zyedidia/micro/releases/download/v2.0.8/micro-2.0.8-linux-arm.tar.gz | sudo tar xvz -C /usr/local/bin/ --wildcards "micro-*/micro" --strip-components=1
curl -s -L https://github.com/zyedidia/micro/releases/download/v2.0.8/micro-2.0.8-linux64.tar.gz | sudo tar xvz -C /usr/local/bin/ --wildcards "micro-*/micro" --strip-components=1
| var subscription Subscription | |
| err := json.NewDecoder(r.Body).Decode(&subscription) | |
| if err != nil { | |
| http.Error(w, err.Error(), http.StatusBadRequest) | |
| return | |
| } | |
| defer r.Body.Close() |
| package main | |
| func main() { | |
| http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
| fmt.Fprintf(w, "Hello world!") | |
| }) | |
| port := os.Getenv("PORT") | |
| if port == "" { | |
| port = "8080" |