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?

    Can you run a command to re-size only certain image types in Magento2?

    This is related to v2.3.x

    I would assume not, looking at the code of Magento 2 ImagesResizeCommand.

    You might need to create a new custom module to override function execute() and possibly target information inside $resizeInfo() array, for example filename.

    (For example, you might create new custom arguments to the constructor in your module and target those conditions)

    NOTE: I see the upcoming v2.4x version will be vastly different – functions like executeSync and executeASync will handle the execute() independently.

    How can I run two instances of WhatsApp on a Mac?

    I have two phone numbers for two purposes and I would like to run two native WhatsApp clients in parallel on my Mac.

    I don’t want to use the browser (or two browser windows) since I prefer the native Mac OS apps.

    How can I do that?

    linux – can’t able to run node from wsl bash

    I run linux Ubuntu on windows using “Windows Subsystem for Linux”.

    I try to run node from wsl bash.

    I get this error:

    Command 'node' not found, but can be installed with:
    
    sudo apt install nodejs
    

    I have installed node on my windows 10.

    But when I typing node.exe is works.

    This is a problem since npm is not working (npm.cmd) and binary files like lerna run node without the ext.

    So how to solve this problem?

    enter image description here

    roblox – How do I run a client-side script on a game that’s not mine?

    I need to run an exploit script, but I won’t get caught, because it’s not for cheating. What’s the best exploit script runner for mac?

    The client-side script is:

    for i, v in pairs(game:GetDescendants()) do
        if v:IsA("Sound") then
            print(v.SoundId)
        end
    end 
    game.DescendantAdded:Connect(function(Obj)
        if Obj:IsA("Sound") then
            print(v.SoundId)
        end
    end
    

    I need to run it.

    How?

    gm techniques – How do I run an adventure with the party in competition with an NPC party in a race for the MacGuffin?

    I’m looking at the next leg of our campaign being a “race for the MacGuffin” scenario. The PCs (Rolemaster) have been chasing an evil sorceress for a while now. I want to let them catch up but put them in a position where they can’t actually kill her. She’s working for someone powerful who will come after them if they kill her. But it’s in a mercenary role so if they can get the MacGuffin for him he won’t care what happens to her after that.

    The problem: I’ve never run or even read an adventure with competing adventuring parties. Can someone point me to some good resources?

    I’m looking for published adventures (from any system), blog posts with adventure design ideas, direct advice from the folks here, and/or anything else that can help me figure out how to pit one party against another without having it be a straight up brawl.

    firefox – How can I run this script in Chrome on Android?

    I want to run this script from the search bar to be able to inspect items on Android and it will move the console without leaving the page
    This is the script:

    javascript: (function () {
        var script = document. createElement ('script'); 
        script. src = "https://cdn.jsdelivr.net/npm/eruda"; 
        document. body. appendChild (script); 
        script. onload =  function () {eruda. init ()}
    }) ();
    

      I remove the IIfe wrapper and it still doesn’t work

      Does anyone know what to do?

      I leave the github repository here:
      https://github.com/liriliri/eruda/blob/master/README.md

    virtualization – Is it safer to run executable file (not safe, may contain virus) on VBox

    I have a host system (Windows 10) with premium antivirus and running a Windows 7 in Virtualbox with no antivirus. I have installed sandboxie and try to run executable files that may contain virus. Is it safe to run those applications? and what will be the effect if the virus slips out. I know this is a dumb question even after knowing about sanboxie. But I would like to know the consequences that occur.

    Also, I would like to know how it affects the host machine if I run that exe file without sandboxie on Virtualbox.

    Since there are many viruses and trojans that silently triggers even without running the exe file. Just want to learn the consequences that virus can damage. (P.S that I still having the antivirus on on the host machine).

    front end – Frontend/Backend Integration: Wait for a Google Cloud function to run and then return result

    I am trying to create a tool that receives a user input on the front end, uses that input to run a Google Cloud function and then returns a link to the output, hosted on Google cloud as well.

    How can you give updates that a process is being performed, and update the page when it is finished?

    diagnostic – How long should I expect the Apple IIc self test to run?

    I purchased a vintage Apple IIc computer and I want to make sure there are no failing components. I booted up the computer while pressing both Apple keys (open and close) at the same time. The computer went into the self-test mode:

    enter image description here

    However, this test has been running for more than 1 hour now. It has been decades since I have used one of these machines, so I am not sure if this is to be expected, or if the long run time is an indication of some issue.

    Does anyone know how long this test should run?

    Also, do I need to have a blank floppy disk in the internal drive in order for it to test the drive as well?