https://github.com/dockersamples/gopher-task-system
A Task System using Go Docker SDK.
https://github.com/dockersamples/gopher-task-system
docker go sdk
Last synced: about 1 year ago
JSON representation
A Task System using Go Docker SDK.
- Host: GitHub
- URL: https://github.com/dockersamples/gopher-task-system
- Owner: dockersamples
- License: mit
- Created: 2022-07-07T05:05:54.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-01T03:38:39.000Z (over 1 year ago)
- Last Synced: 2025-03-26T10:11:20.102Z (about 1 year ago)
- Topics: docker, go, sdk
- Language: Go
- Homepage:
- Size: 606 KB
- Stars: 24
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Task Management application using Go
A simple task system using Go Docker SDK.
## Prerequisites
- Go (tested with 1.17.2)
- Docker
## Steps to Run
- Clone the repository
```sh
git clone https://github.com/dockersamples/gopher-task-system.git
```
- Project directory structure
```
$ tree
.
├── LICENSE
├── README.md
├── go.mod
├── go.sum
├── internal
│ ├── container-manager
│ │ └── container_manager.go
│ ├── task-runner
│ │ └── runner.go
│ └── types
│ └── task.go
├── main.go
└── task.yaml
4 directories, 9 files
```
- Build the task system
```sh
go build -o gopher
```
- Run tasks
```sh
$ ./gopher run task.yaml
preparing task - gopher-loops
preparing task - hello-gopher
starting task - gopher-loops
starting task - hello-gopher
completed task - hello-gopher
completed task - gopher-loops
```

- Run `docker ps -a` to see what all task containers
```sh
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
396e25d3cea8 busybox "sh -c 'for i in `se…" 6 minutes ago Exited (0) 6 minutes ago gopher-loops
aba428b48a0c busybox "echo 'Hello, Gopher…" 6 minutes ago Exited (0) 6 minutes ago hello-gopher
```
## Sequence Diagram
