The memo I wrote before came out, so I will write it as an article.
How to run Athrill with Docker
https://qiita.com/kanetugu2018/items/f1368a6da7bdc773cfd9
Although it is introduced in, I would like to make it as small as possible because it is a good idea. It would be interesting to be able to move several or dozens of Athrills at the same time in the garden.
This time, I would like to configure it from Docker's scratch.
If you build athrill normally, it will use the dynamic link library, so If you try to run it in an environment with nothing in it, it will be moss.
Therefore, rebuild it statically.
Change the Makefile to something like this
/trunk/src/build/target/linux_v850e2m/Makefile
28: $(GCC) -O3 $(LFLAGS) $(AROBJS) -o $(TARGET) $(LIBS) -static
Rebuild.
$ make clean; make
Dockerfile Create a folder for docker and statically build athrill Collect the binaries, asp and configuration files to be used, and create a Dockerfile there.
FROM scratch
COPY athrill2 .
COPY asp .
COPY memory.txt .
COPY device_config.txt .
CMD ["./athrill2", "-i", "-m", "memory.txt", "-d", "device_config.txt", "asp"]
If you notice it now, you don't need to pass the option with CMD. Just hit athrill It seems more straightforward to pass it as an argument.
docker build -t athrill .
docker container run -it athrill
Recommended Posts