Why is envsubst with a pre-defined set of variables not working in a docker container?

I learned in https://unix.stackexchange.com/questions/294378/replacing-only-specific-variables-with-envsubst how to replace only a set of variables when using envsubst.

I have a file infile with the following content:

VAR1=$  var1 VAR2=$  var2 VAR3=$  var3 

Let’s say I only want to replace $ var1 and $ var2, and leave $ var3 untouched.

I do the following on my machine:

export var1=one export var2=two export var3=three envsubst '$  var1 $  var2' < infile 

This gives:

VAR1=one VAR2=two VAR3=$  var3 

Great, that works!

Next, I want to do the same in a docker container. I extracted my problem to the following:

docker run -e var1=one \            -e var2=two \            -v /home/robin/temp:/robin \            ubuntu:18.04 \            bash -c "apt update && apt install gettext -y && \                     envsubst '$  var1 $  var2' < /robin/infile" 

This however gives:

VAR1=$  var1 VAR2=$  var2 VAR3=$  var3 

So in other words, the replacement did not happen.

Why is that and is there a way to fix it?

Even more strange (to me at least), is that when I omit '$ var1 $ var2', and thus let envsubst replace everything, the replacement just works:

docker run -e var1=one \            -e var2=two \            -v /home/robin/temp:/robin \            ubuntu:18.04 \            bash -c "apt update && apt install gettext -y && \                     envsubst < /robin/infile" 
VAR1=one VAR2=two VAR3= 

unable to update ubuntu Docker container using apt-get update

when I run ubuntu as Docker container and when I run apt-get update command it gives error and fails to update the repos.

Here is what error I’m getting :

root@df167e514b29:/# sudo bash: sudo: command not found root@df167e514b29:/# apt-get update Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.ubuntu.com' Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Temporary failure resolving 'security.ubuntu.com' Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Temporary failure resolving 'archive.ubuntu.com' Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Temporary failure resolving 'archive.ubuntu.com' Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Temporary failure resolving 'security.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead. root@df167e514b29:/#

How to configure Burp Suite for traffic to/from Docker container?

as titled really, I’m running https://github.com/OWASP/SecurityShepherd/wiki/Docker-Environment-Setup successfully in a container. However, this is only really useful if you can inspect the traffic.

I have it setup as normal to intercept all traffic, however, seems this doesn’t apply to the container. I tried changing it to all interfaces as well without success.

I’m wishing to use this for some classroom training so perhaps I’m best going with a cloud setup?

Thanks

How to recover the unreadable files on the mounted standard VeraCrypt container? [migrated]

My hard disk had 3 partitions C, D and E, and I formatted everything on the E drive and extended the size of the D drive using Easeus Partition Master by adding E drive to D. So now the size of the partition D is 500.5 GB , then I created a new 500 GB standard encrypted VeraCrypt container on the D drive. Remaining (non-encrypted space) space on the D drive is 500 MB. Now there is only C and D drive as I extended the size of the D drive using Easeus partition master by combining E drive to D!

Before the formatting and extending the partition of E to D, I copied all data on the E drive to an external Western Digital 4TB drive but there was a 50 GB VeraCrypt file container on that drive ( E DRIVE ) which I marked as hidden from the windows explorer to prevent other users from deleting it. I forgot that there was that VeraCrypt file container on E drive and it didn’t copy to the External drive as it was hidden from the windows explorer.

Does making a 500 GB standard encrypted VeraCrypt drive on the D drive overwritten the D drive which has a size of 500 GB?

I also used Kerish Doctor to prevent that VeraCrypt file container from accidental deletion, today I found that 50 GB VeraCrypt file container on C:\ProgramData\Kerish Products\Kerish Doctor\Restore folder and I copied it to an external drive and successfully mounted the drive using VeraCrypt, but only 3 or 4 files out of 500 files are readable (They are mostly videos, photos)

The file extension that Kerish Doctor saved the file to prevent deletion is in .rst ON C:\ProgramData\Kerish Products\Kerish Doctor\Restore folder.

How do I recover all or most of the data on that drive? See the attached photo, it is how most of the files on that drive looks like and they are corrupted

enter image description here

and opening any of those files gave me below error on the attached photo!

enter image description here

Cant connect to external App from the docker container

I have a rest api based microsercvice application where I have multiple docker containers within a dev-server. The IP of dev-server is 10.192.168.xxx. I have the an external application to which I need to make some API calls at 10.192.167.xxx. I am able to ping or make API calls to the external server from the dev-server, but I am not able to do the same form within any of the containers. Please help me.

How to keep changes after service restart in Tomcat docker container?

I have the latest tomcat container (image: 89481b5d9082). I want to change the default port of Tomcat. After editing the configurations I am required to restart the Tomcat service. Upon doing so the container stops (I assume it is “kept alive” by the running Tomcat) and when I start this container again the changes are lost.

How can I make these changes and keep them after service restart?

Como soltar o drag em qualquer lugar no container

Eu resolvi criar uma aplicação WEB usando interação com o usuário usando a API Drag And Drop (Arrastar e soltar) do JavaScript.

<html> <head>   <meta charset="UTF-8">   <style>        body {         margin: 0;       }        * {         margin: 0;       }          #drag {         width: 100px;         height: 100px;         background: rgb(110, 107, 107);         position: relative;       }        #drop {         width: 200px;         height: 200px;         background: rgb(177, 174, 174);         position: absolute;         top: 0;         left: 200px;       }        .paragraph {         position: absolute;         left: 50%;         top: 50%;         transform: translateX(-50%) translateY(-50%);         font-family: Arial, Helvetica, sans-serif;         font-size: 20px;         color: rgb(255, 255, 255);       }    </style> </head> <body>  <div id="drag" draggable="true"><p class="paragraph">Arraste</p></div> <div id="drop"><p class="paragraph">Solte</p></div>  <script>      let drag = window.document.querySelector("#drag");     let drop = window.document.querySelector("#drop");      drag.addEventListener("dragstart", function (event)     {       event.dataTransfer.setData("text", event.target.id);     });      drop.addEventListener("dragover", function (event)     {       event.preventDefault();       drop.style.border = "5px dotted rgb(120, 120, 120)";     });      drop.addEventListener("dragleave", function (event)     {       drop.style.border = "none";     });      drop.addEventListener("drop", function (event)     {       event.preventDefault();       let data = event.dataTransfer.getData("text");       event.target.appendChild(window.document.getElementById(data));       drop.style.border = "none";     });  </script>  </body> </html>

Esse código em cima é só um pequeno pedaço da aplicação que eu estou criando só coloquei o código necessário para não ficar muito grande o código, e vocês não perderem tempo visualizando o código por inteiro. Mas o meu problema é o seguinte o Drag And Drop do código acima funciona normalmente, porém quando você arrasta(drag) a div com id="drag"e solta(drop) ela na div com id="drop" a div#drag fica dentro da div#drop em uma posição left: 0 e top: 0 em relação ao seu container pai. O que eu gostaria era que na hora de arrastar a div#drag e soltar ela dentro da div#drop não importa aonde você está soltando a div#drag ela permanecerá na posição em que você soltou dentro da div#drop. Aqui eu citei alguns sites que usam o Drag And Drop em que o mesmo efeito que eu gostaria que acontecesse com a minha aplicação. Material Angular, Scratch.

Minecraft suddenly crashing when opening container

I have been playing Minecraft on my HP Pavillion for over 2 years and suddenly the other day it started crashing. When I went through the logs, I found an error that when I search it on google is said to be a ‘video driver’ issue. Has something changed recently in either the openGL or Radeon drivers?

Error from launcher logs:

[Info: 2019-07-09 23:00:47.099781657: GameCallbacks.cpp(138)] Launcher/launcher  (main) Info  ../src/gallium/drivers/r600/sb/sb_ir.cpp:340:update_packed_items: Assertion `!sw p[chan] || swp[chan] == v' failed. [Info: 2019-07-09 23:00:47.099916121: GameCallbacks.cpp(138)] Launcher/monitor (Process Monitor) Fatal Process crashed with exit code 6 [Info: 2019-07-09 23:00:47.102898019: GameController.cpp(330)] Game closed with id 1 [Info: 2019-07-09 23:00:47.103385699: NetQueue.cpp(529)] NetQueue: Starting net action http://hopper.minecraft.net/crashes/submit_report/ [Info: 2019-07-09 23:00:47.324936561: NetQueue.cpp(396)] NetQueue: Primary ip: 50.19.104.190, Url: hopper.minecraft.net [Info: 2019-07-09 23:00:47.325115228: NetQueue.cpp(428)] NetQueue: Action failed with result "The requested URL returned error: 400 BAD REQUEST" (22) : http://hopper.minecraft.net/crashes/submit_report/ [Info: 2019-07-09 23:00:47.325137917: NetQueue.cpp(467)] NetQueue: Action finished: http://hopper.minecraft.net/crashes/submit_report/ [Info: 2019-07-09 23:00:47.325324168: GameCallbacks.cpp(33)] Destroying GameCallbacks! 

Does USB read-rate from a camera device degrade when running inside of a docker container?

I have a general question regarding usb device performance inside of a docker container.

For context, I have setup a docker image (for deploying containers on an nvidia jetson agx xavier platform) to set up a camera publisher in ros to stream data from a realsense d435i camera plugged into the jetson via USB 3.2. I run this container with the --privileged option, as well as mounting the host volume /dev via -v /dev:/dev in the run command and I am able to bring up the node and run pretty reliably @15 fps at the camera’s lowest resolution. Additionally, I am able to view the camera stream on a separate host machine (connected over wlan) and the output looks pretty good.

I am trying to identify potential reasons why I cannot increase the frame-rate or the resolution without causing my ros node to crash. One of the issues, potentially, is the read-rate of my usb device when being read from within a running container. I am new to docker, and I would appreciate any general info and/or links about how running a docker container on a host machine can impact usb performance. Any relevant info would be of great use to me. Thanks!

Colocando width dinamico em um Container

Olá! Eu estou querendo usar esse controle para substituir as Dropdown, mas percebi que o comando width dele ‘não funciona’, talvez pelo contexto externo a ele, não entendi direito. Pois eu quero na verdade tornar dinamico com valor em double que já tenho preparado, mas mesmo colocando na valor fixo ali 200.0 não obecede:

inserir a descrição da imagem aqui

Código Flutter:

            SizedBox(               height: 34.0,               child: GridView(                 padding: EdgeInsets.symmetric(vertical: 4.0),                 scrollDirection: Axis.horizontal,                 gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(                     crossAxisCount: 1,                     mainAxisSpacing: 8.0,                     childAspectRatio: 0.5),                 children: todostimes.times.map((s) {                   return GestureDetector(                       onTap: () {                         setState(() {                           _timeSelecionado = s;                         });                       },                       child: Align(                         alignment: Alignment.topCenter,                         child: Container(                           decoration: BoxDecoration(                               borderRadius: BorderRadius.all(Radius.circular(5.0)),                               border: Border.all(                                   color: s == _timeSelecionado                                       ? Colors.deepPurple                                       : Colors.grey[400],                                   width: 2.0)                           ),                           width: 200.0, //valor fixo                           //convertDouble(s['TimeNome'].toString()) ,                           padding: EdgeInsets.all(2.0),                           child: Text(s['TimeNome'],                               style: new TextStyle(                                 fontSize: 15.0,                               )                           ),                         ),                       ));                 }).toList(),