Simple lightweight container to run Ubuntu's id3tool
without having to install Ubuntu.
This uses minideb
and the latest id3tool
at the time of publication (v1.2a-11
).
Note: I haven't explored buildx
yet as a multi-arch solution.
This project is now on Docker Hub under the same name (mikeoertli/id3tool)! Instead of needing to clone this repo and build, you can just pull down the pre-built images and run with those.
The docker pull
command is:
docker pull mikeoertli/id3tool
This tool is part of Ubuntu.
The ARM binary is retrieved from this launchpad.net resource.
The AMD binary is retrieved from this launchpad.net resource.
The id3tool
version number is kept in id3tool-version.txt
so this build command doesn't need to change.
However, the Dockerfile
is currently manually kept in sync with the txt
file.
Building ARM:
docker build --platform linux/arm64 -t mikeoertli/id3tool:"$(cat id3tool-version.txt)-arm64" -t mikeoertli/id3tool:latest-arm64 .
Building AMD:
docker build --platform linux/amd64 -t mikeoertli/id3tool:"$(cat id3tool-version.txt)-amd64" -t mikeoertli/id3tool:latest-amd64 -f Dockerfile.amd64 .
These images are published to Docker Hub under mikeoertli/id3tool
.
Right now, GitHub actions only support amd64
architecture, so for now, those are the only images that are build and published automatically.
Images for arm64
architecture must be pushed manually, the command to do that is:
docker push mikeoertli/id3tool:"$(cat id3tool-version.txt)"-arm64
Images for amd64
architecture are pushed when tagging the repo with a tag matching the format of v*.*-*
.
In addition to automatic publication via GitHub Actions, repos can also be pushed manually, the command to do that is:
docker push mikeoertli/id3tool:"$(cat id3tool-version.txt)"-amd64
There are a couple important items to note:
- You will need to provide a file name.
- As shown below, a Docker Volume is created that maps the current working directory on the host machine to
/temp
inside the container. - The
WORKDIR
is/temp
, since this is where files are expected, a relative file reference is fine.
docker run -it --name id3tool --rm -v $(pwd):/temp mikeoertli/id3tool:latest-arm64 <switches> "<FILE>"
You can still pass command line args, for example, if you want to print the help guide, you can do that with -h
or --help
just like you normally would (or you can omit all args and options and the default is to display the --help
output).
docker run -it --name id3tool --rm -v $(pwd):/temp mikeoertli/id3tool:latest-arm64 --help
More useful info about options for id3tool
can be found via ubuntu.com.
The --rm
on the run
command will auto-delete the container when it stops (you can read more about this here). This makes it easier to use this containerized id3tool
solution in a way more similar to running it natively (this can be helpful when called from a script, too).
The container sets a CMD
value of --help
, this serves as the default parameter if none is provided when the container is run. According to the Dockerfile Best Practices:
The best use for
ENTRYPOINT
is to set the image’s main command, allowing that image to be run as though it was that command (and then useCMD
as the default flags).
To put it differently, if you don't pass an audio file argument to the docker run
command, you're effectively performing the equivalent of executing id3tool --help
from a native command line.
In order to make this (appear to be) a "true" drop-in replacement for running id3tool
natively, you could define an alias... something like this:
alias id3tool='docker run -it --name id3tool --rm -v $(pwd):/temp mikeoertli/id3tool:latest-arm64'