https://github.com/cbdq-io/docker-avro-tools
Make avro-tools available via a Docker container.
https://github.com/cbdq-io/docker-avro-tools
apache-avro docker hacktoberfest
Last synced: 5 months ago
JSON representation
Make avro-tools available via a Docker container.
- Host: GitHub
- URL: https://github.com/cbdq-io/docker-avro-tools
- Owner: cbdq-io
- License: mit
- Created: 2023-01-29T09:12:07.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2025-01-11T12:37:26.000Z (over 1 year ago)
- Last Synced: 2025-01-11T13:37:58.184Z (over 1 year ago)
- Topics: apache-avro, docker, hacktoberfest
- Language: Python
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-avro-tools
[](https://github.com/cbdq-io/docker-avro-tools/actions/workflows/pipeline.yml)
Make [avro-tools](https://avro.apache.org/docs/1.12.0/getting-started-java/)
available via a Docker container.
## Example
Say we have a file called `tests/resources/AccountService.avdl` that contains
the following IDL code:
```
@namespace("org.sample")
protocol AccountService {
record Account {
long id;
string name;
union {null, string} description = null;
}
Account addAccount(string name, union {null, string} description);
}
```
Then running the following command:
```shell
docker run \
--rm \
--volume "$( pwd )/tests/resources:/mnt/idl" \
--volume /tmp:/mnt/schemas \
ghcr.io/cbdq-io/avro-tools:1.12.0 \
idl2schemata /mnt/idl/AccountService.avdl /mnt/schemas
```
will create a file called `/tmp/Account.avsc` with the following contents:
```json
{
"type" : "record",
"name" : "Account",
"namespace" : "org.sample",
"fields" : [ {
"name" : "id",
"type" : "long"
}, {
"name" : "name",
"type" : "string"
}, {
"name" : "description",
"type" : [ "null", "string" ],
"default" : null
} ]
}
```