Community discussions

MikroTik App
 
User avatar
dynek
Member Candidate
Member Candidate
Topic Author
Posts: 221
Joined: Tue Jan 21, 2014 10:03 pm

RB5009 Hello World

Sat Apr 01, 2023 10:00 am

Hello everyone,

I have just bought a RB5009 and the first thing I wanted to try is container. The below has been tested on 7.8 and 7.9rc1.
However they don't seem to have a constant behavior, even with a simple library/hello-world:latest image, e.g.:
/interface/veth/add name=veth1 address=172.17.0.2/24 gateway=172.17.0.1
/container/add remote-image=hello-world:latest root-dir=hello interface=veth1 logging=yes
/container/start 0

The image is pulled from the docker hub, and status remains stopped. And I can't start it, there is no result coming from trying to start it:

mar/31 20:32:15 container,info,debug importing remote image: hello-world, tag: latest
mar/31 20:32:15 system,info item added by admin
mar/31 20:32:18 container,info,debug getting layer sha256:7050e35b49f5e348c4809f5eff915842962cb813f32062d3bbdd35c750dd7d01
mar/31 20:32:19 container,info,debug layer sha256:7050e35b49f5e348c4809f5eff915842962cb813f32062d3bbdd35c750dd7d01 downloaded
mar/31 20:32:19 container,info,debug import successful, container d4421f05-3684-465c-ba83-24cb6029af65
I have enabled logging "container" but nothing further show up in the logs.

I then tried other containers like nginx and sometimes it works, sometimes not, sometimes I can then start the Hello World container, the behavior is not consistent and always reproducible the same way.

Are containers supposed to be stable ?
 
User avatar
dynek
Member Candidate
Member Candidate
Topic Author
Posts: 221
Joined: Tue Jan 21, 2014 10:03 pm

Re: RB5009 Hello World

Sat Apr 01, 2023 10:03 am

I'm also seeing weird things such as, not being able to spawn a shell before I first print containers (yes container was fully started):
[admin@MikroTik] > /container/shell 1
container not running
[admin@MikroTik] > /container/shell 1
container not running
[admin@MikroTik] > /container/shell 1
container not running
[admin@MikroTik] > /container/shell 1
container not running
[admin@MikroTik] > /container/shell 1
container not running
[admin@MikroTik] > /container/print
 0 name="80cbd723-db5f-410b-8dd6-07416e17e905" tag="library/hello-world:latest" os="linux" arch="arm64" interface=veth1 root-dir=hello mounts="" dns="" logging=yes status=stopped

 1 name="29ba314b-229a-42fd-a3bd-08fca64d612a" tag="library/nginx:stable-alpine3.17-slim" os="linux" arch="arm64" interface=veth2 root-dir=nginx mounts="" dns="" logging=yes status=running
[admin@MikroTik] > /container/shell 1
/ #
 
User avatar
dynek
Member Candidate
Member Candidate
Topic Author
Posts: 221
Joined: Tue Jan 21, 2014 10:03 pm

Re: RB5009 Hello World

Sat Apr 01, 2023 10:06 am

And once on a shell, it remains open even if I stop/start the container but commands end up with:
/ # ls -lsa
/bin/sh: can't fork: Out of memory
 
User avatar
jvanhambelgium
Forum Veteran
Forum Veteran
Posts: 985
Joined: Thu Jul 14, 2016 9:29 pm
Location: Belgium

Re: RB5009 Hello World

Sat Apr 01, 2023 11:45 am

Last week I disabled my Pi-hole container on RB5009 and returned to the container on my Synology NAS where it used to work flawlessly for years.
"Once it runs" it is quite stable, but I experienced things like ; cannot start container anymore after an update-only reboot helps, USB-storage disk "id" changing between reboots, breaking the container
Currently running 7.8 "stable" and probably will keep doing so unti 7.9 gets a "stable" status
 
tangent
Forum Guru
Forum Guru
Posts: 1333
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: RB5009 Hello World

Thu Apr 13, 2023 3:28 pm

/container/add remote-image=hello-world:latest root-dir=hello interface=veth1 logging=yes
… status remains stopped.

Of course the status is "stopped." It runs, prints out its "hello, world" message, then stops. That's what that container does. And that's all it does.

That isn't the problem with this container. The problem is that it doesn't obey ROS's current overly-picky rules on how a container's filesystem is laid out, so it silently fails to start.

I've built a container that does work and is more appropriate for the purpose of testing container logging on ROS besides, here. I've tested it successfully on an RB4011, but its tiny size means it should run on any ARM device MikroTik is shipping today.

I then tried other containers like nginx

Sigh. Why do people always go for the single most popular, featureful, industrial-grade, big-iron program when first testing out RouterOS containers? These are small ARM boxes! Find something slimmer, more appropriate to the purpose.

Are containers supposed to be stable ?

For suitably-scoped definitions of "stable," yes. :)
 
User avatar
dynek
Member Candidate
Member Candidate
Topic Author
Posts: 221
Joined: Tue Jan 21, 2014 10:03 pm

Re: RB5009 Hello World

Thu Apr 13, 2023 3:54 pm

Of course the status is "stopped." It runs, prints out its "hello, world" message, then stops. That's what that container does. And that's all it does.

This I know, but even when I start it nothing gets printing in the logs. But sometimes in does depending on the sequence I use to create containers. But I think you answered the question when mentioning "it silently fails to start", Mikrotik said they would fix this: viewtopic.php?p=996109#p996120

Sigh. Why do people always go for the single most popular, featureful, industrial-grade, big-iron program when first testing out RouterOS containers? These are small ARM boxes! Find something slimmer, more appropriate to the purpose.

Got your point, even though ARM64 is powerful enough for small workloads. I haven't planned on running nginx in there and I feel like `nginx:stable-alpine3.17-slim` is lightweight enough to make a test or two.

Thank you for your help!
 
User avatar
jvanhambelgium
Forum Veteran
Forum Veteran
Posts: 985
Joined: Thu Jul 14, 2016 9:29 pm
Location: Belgium

Re: RB5009 Hello World

Thu Apr 13, 2023 3:59 pm

since I've inserted a USB 2.0 "hub" into the RB5009 and then my SDCARD in it the disk-id remains consistent across reboots. The problem was that sometimes the card is seen as USB 3.0 and sometimes USB 2.0 which results in differend "disk" ID's.

At the moment I have 4 containers running stable for several days ; pi-hole , openspeedtest , iperf3 , caddy
 
tangent
Forum Guru
Forum Guru
Posts: 1333
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: RB5009 Hello World

Thu Apr 13, 2023 4:28 pm

…"it silently fails to start"…Mikrotik said they would fix this

You don't need to tell me. I'm the one who diagnosed the empty directory issue and reported it to MikroTik. :)

And that is why I was able to build the "tangentsoft/echo:latest" container for you.

ARM64 is powerful enough for small workloads

"ARM64" tells you nothing about RAM, disk, or all the background processes trying to make use of that same CPU for other things, like, oh, say, routing?

You're right that the "alpine slim" nginx image is a lot better than Docker's official full-featured nginx images, but I was thinking more along the lines of lighttpd. While it is also 5 megs compressed, most of that's the Alpine base, and I expect it'd be easier to carve that away in the case of lighttpd than nginx.

That's speculation since I haven't got any reverse proxies running on ROS at the moment, but if I were to dive into the project, I'd expect to come out of it in the end with something that'll run even on a 16 meg flash device with enough room to spare to allow OS upgrades.
 
User avatar
antonsb
MikroTik Support
MikroTik Support
Posts: 385
Joined: Sun Jul 24, 2016 3:12 pm
Location: Riga, Latvia

Re: RB5009 Hello World

Mon Apr 17, 2023 6:09 pm

Now hello-world should work. Thanks @dynek and @tangent for helping solving this. Fix will be included in upcoming beta version.
 
User avatar
dynek
Member Candidate
Member Candidate
Topic Author
Posts: 221
Joined: Tue Jan 21, 2014 10:03 pm

Re: RB5009 Hello World

Tue Apr 25, 2023 6:54 pm

@antonsb not in RC4, right ?
 
tangent
Forum Guru
Forum Guru
Posts: 1333
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: RB5009 Hello World

Wed Apr 26, 2023 12:14 am

I'm pretty sure he means 7.10beta, whenever that appears.

Who is online

Users browsing this forum: No registered users and 4 guests