docker – How to bind a port in a “host” network mode from a container run by a rootless dockerd?

  • Install rootless dockerd on Ubuntu 20.04:

    $ curl -fsSL https://get.docker.com/rootless | sh
    $ export PATH=$HOME/bin:$PATH
    $ export DOCKER_HOST=unix:///run/user/1000/docker.sock
    
  • Run rootless dockerd:

    $ dockerd-rootless.sh --experimental
    ...
    INFO(2020-06-03T16:53:51.690572434+02:00) API listen on /run/user/1000/docker.sock
    
  • Check container in non-host network mode (SUCCESS):

    $ docker run --rm -it -p 8080:8080 python python -m http.server 8080
    Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
    

    On other terminal:

    $ curl http://localhost:8080
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    ...
    
    $ lsof -i :8080
    COMMAND      PID    USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
    rootlessk 116618 marcinr    9u  IPv6 2313409      0t0  TCP *:http-alt (LISTEN)
    
  • Try to run in “host” network mode (FAILURE):

    $ docker run --rm -it --network host python python -m http.server 8080
    Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
    

    On other terminal:

    $ curl http://localhost:8080
    curl: (7) Failed to connect to localhost port 8080: Connection refused
    
    $ lsof -i :8080
    <empty>
    

    I know I can run these commands using nsenter:

    $ nsenter -U -n -t $(cat /run/user/1000/docker.pid) lsof -i :8080
    COMMAND    PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
    python  119656 root    3u  IPv4 2360676      0t0  TCP *:http-alt (LISTEN)
    

    but I want to be able to use my web application in a web browser, not in the terminal only.

  • My question is: how to publish the port 8080 to the host in a “host” network mode using rootless dockerd? Should i run dockerd-rootless.sh script or even a raw rootlesskit with specific arguments to achieve this?

    cpu – ASRock Extreme Tuning fan control will not return to silent mode after lowering temperature

    I have an Asrock Z77 Pro3, I updated it today to the latest bios version available.
    I use the ASRock Extreme Tuning application to control my CPU and case fan, both PWM.

    Everything works perfectly / silently when the load is low, when the temperature gets over my set threshold the fans start doing their work.
    I wait for them to be silent again but this simply never happens…
    If I open the ASRock Extreme Tuning fan control software and check the temp values I see that all is back in normal range but the fans keep on violently whirring.

    If I simply click on “Apply” the settings (without changing what is already there) the fans become silent immediately.

    Sadly, next time it happens, it behaves identically as explained before.
    It feels like the tool is never polling for Temps again after the high temp trigger…

    Do you have any suggestion?

    sharepoint online – Add SPFX extension when document is opened in SPO mode

    Stack Exchange Network


    Stack Exchange network consists of 177 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

    Visit Stack Exchange

    unity – Have a particle system’s particles obey transparency sort mode individually

    Background

    In a top-down game, I have particles that spawn animated textures. I have my 2D renderer settings set-up so that it orders sprites based on their position on th Y-axis via “Transparency Sort Mode > Custom Axis > Y”.

    The Problem

    But instead of sorting for each particle spawned, what happens is the particle system obeys the setting as a whole so that the sort order is only based on the particle’s system’s center.

    Is there a way to have each particle obey Transparency Sort Mode individually?

    Other Solutions

    Other people seem to have an old workaround to use GetParticles and setting their “order in layer” individually. See this thread from 2015:

    https://forum.unity.com/threads/particle-systems-with-sprites-order-in-layer.464533/

    But I’m trying to find if there’s a cleaner solution for Unity 2019 without having to fudge with “order in layer”.

    mojave – Is it a MacOS normal behavior to switch between desktops slower while in Mission Control mode?

    This is more of a performance issue than anything else.

    Bringing up Mission Control is already a pretty complex split-second animation for your Mac to handle, especially if you have several windows open in your current desktop.

    And if you have multiple desktops with several windows open, it has to render all the windows, grouped by application per desktop, and give them a different effect than usual (drop shadows are applied on the window group rather than individual windows in Mission Control) and so on.

    Basically, it’s a more complex task for your Mac to do, and since you’re on Mojave, system UI is largely Metal, so if you have an nVidia chip or older intel graphics with no Metal 2 support, unfortunately it will feel like molasses.

    The only solution would be to upgrade your hardware, or turn off the special effects by going to System Preferences -> Accessibility -> Display then checking reduce motion, reduce transparency, either one or both, depending on what you are willing to give up and how much of an improvement checking the options yield.

    do i need to turn on monitor mode while doing MITM attack and arp spoofing?

    I want to my attack my old PC by ARP spoofing and do some MITM attack .So i was wondering if i need to turn on monitor mode or i can do those attack in managed mode?

    catalina – New MacBook Pro failed on OS reinstall, how do I get it out of Internet Recovery Mode?

    I just got a new 16″ MacBook Pro but things have gone awry while migrating my data from another Mac. Would appreciate any advice you might have.

    When I opened the new computer, I turned it on and made a new account just to make sure it worked. Seeing that it did, I began the data migration process from my old MBP (still running Mojave) using Migration Assistant. The migration seemed to be going ridiculously slowly to the point that I thought it was frozen. I then realized that I could get all the data from Time Machine on my backup drive, so I cancelled the process.

    To make sure I had a clean start again, I rebooted the new computer in recovery mode and reinstalled MacOS Catalina. But unfortunately this stopped halfway through claiming there was an internet problem (I was seated right next to my router).

    After this point, whenever I restarted the computer, it would either flash the folder with the question mark (i.e. no bootable drive found) or it would enter internet recovery mode. In the case of the latter, I would enter my wifi password and then it would gyrate for about 10 minutes until it gave up, showing the failed globe icon along with the message “apple.com/support -2002F“. I wasn’t able to enter the typical recovery menu at all.

    Now no matter what I do, it boots into internet recovery mode: booting up normally, holding CMD + R, holding Option + Cmd + R, etc. I have created and inserted two bootable USB drives into the computer, one with Catalina and the other with Mojave. When I hold Option while starting up, it correctly displays the two drives (and the wifi menu underneath). But when either is selected, it goes back into internet recovery mode anyway.

    Has anyone else experienced problems like this? Anything else I can try? I’m very excited to use my new machine but this is proving to be immensely frustrating so far. Thanks for your time!

    Xiaomi mi a2 lite stuck on headphones mode

    I was doing a mod with my car for an aux input mod but along the way I had to try different pinouts on my radio pcb to get the signal into it from my phone and unfortunately I damaged the phone audio circuit because when i unplug the jack it still puts the signal through headphones and speaker is out of play . I did find a temporary solution using lesser audioswitch app but when i restart the phone it switches again to headphones and I have to manually put it back to speaker mode .Does any one know a way to permanently set the audio output to loudspeaker as I will not use headphones anymore . By the way I physically removed the headphone port on my phone to be sure it is not in short or something. Any solution is appreciated.

    Thanks in advance.

    c++ – How can a system similar to Dwarf Fortress’ legends mode be implemented?

    In Dwarf Fortress, nearly everything that happens during world generation is logged and viewable in legends mode. An XML file containing that information can be exported and loaded into a utility such as Legends Viewer which can show specific events, relationships between two recorded people, what kingdoms people belonged to, etc. What is an efficient approach to logging an extremely large number of events and keeping track of individuals/kingdoms?

    Recover data from Download/Odin Mode on phone that won’t boot into Recovery?

    Stack Exchange Network


    Stack Exchange network consists of 177 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

    Visit Stack Exchange