I am running boot2docker on Mac. I have started a container mounting a volume from my Mac to the container using -v command.
Problem is, all files with special encoded characters simply don't appear in the volume from within the container. The left part of the screenshot is ls from my Mac, and the right is ls from within the container.
It seems to me files with encoding, in this case "Ätt-Arlech-75x75.png" is simply ignored when mounted - how can that be explained, and avoided?
Related
I'm trying to make my system more robust to intrusions and one thing I'd like to do is log all the commands that are run inside a docker image. So this is different than just mounting the .bash_history file, say. It's about sending all shell commands to a log outside the image.
Is there a trick for this?
Once they're on the main system, I'll back them up remotely on a regular basis.
I am trying to use a simple bash script that uses a script in /opt
#!/bin/bash
pvpython=/opt/paraviewopenfoam54/bin/pvbatch
script_path=save_contours.py
$pvpython $script_path
The file pvbatch does exist, however when I try to run the script I get this strange error message which feels like it is missing some characters:
: No such file or directoryaviewopenfoam54/bin/pvbatch
The Ubuntu I am using is Ubuntu 18.04.1 LTS inside a Windows subsystem for Linux. What could cause this error message?
When I run ls -al pvbatch in /opt/paraviewopenfoam54/bin I get
-rwxr-xr-x 1 root root 84200 May 29 2018 pvbatch
cat pvbatch returns an error message
cat: write error: Input/output error
So cat cant read the file which is strange!
My first thought is that there is an issue with the file itself. where was the file created? I see that it is under /opt/paraviewopenfoam54/bin which is a linux managed folder, did you create and edit the file using vim in WSL or did you create it in windows somehow with VS Code or the like?
Let me just check that you are not creating and editing files in windows directly in the /opt folder inside the %LOCALAPPDATA% folders. If the file was created in this method you risk corrupting the WSL installation. Dont Edit WSL files
When using WSL I commonly find issues and especially this Input/output error issue whenever I create a file directly from windows into the Linux filesystem. There are essentially three main ways to fix this specific issue: (these are not steps but rather separate solutions)
-Restart your Ubuntu terminal
-Restart your entire computer
-Delete the file directly from Windows, touch the file, then overwrite the file with the old one
For a more scalable solution, I recommend leaving the file within the windows system and only working within the Linux system within Linux.
I could not find a usable solution to this seemingly simple problem, despite my best efforts.
I'm using MacOS High Sierra 10.13.6
I have a folder I want to copy with the following location:
/Users/ep9k/Desktop/Key-LogEcovaluator/whereami
I want to copy it to this directory using the terminal:
/Users/ep9k/Library/Application/Support/QGIS/QGIS3/profiles/default/python/plugins
I tried the following commands in the terminal. Notice I am in the 'whereami' folder when doing this:
whereami ep9k$ cp -r /Users/ep9k/Desktop/Key-LogEcovaluator/whereami /Users/ep9k/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
whereami ep9k$ cp -a /Users/ep9k/Desktop/Key-LogEcovaluator/whereami /Users/ep9k/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
I'm met with the following message indicating I am not using it correctly:
However, I created a "tester" folder on my desktop and can copy to this folder with no problems, using exactly the same command (except with the pathname changed to my tester folder).
I can also copy and paste things to this directory using the GUI "finder". What am I missing?
Your destination path contains at least one whitespace character ("Application Support"), which causes the "cp" command to think it's being given three arguments instead of two. Enclose the destination path in single or double quotes and you should be all right.
I would like to launch COPY command dockerfile for build image docker with copy bash file from host(windows 10) to ubuntu image like this :
COPY "C:\toto\directory_good\base.sh" /home/docker/scripts/base.sh
I try a lot of possibility but I always have the same error message :
lstat C:\base.sh: no such file or directory
I want to provisionning and configurate my container docker with some few bash file in my windows 10 OS.
What is the correct way to write path windows in Dockerfile. Do you have a example for more understand howto this ?
Use a relative path (not fully qualified with c:\, but relative to the build directory) and switch to forward slashes:
COPY scripts/base.sh /home/docker/scripts/base.sh
When you do a docker build -t myimg:latest ., the last . tells the docker client to send the current directory (excluding anything listed in .dockerignore) to the docker engine to do the build. Anything not included in that directory cannot be included with a COPY or ADD command. The standard process is to place your Dockerfile and all needed dependencies in a single folder, and do your build inside that folder.
Also note that 1.12 added the ability to change the escape character from the backslash that Linux/Unix uses to a backtick. This is defined in a special escape directive at the top of your Dockerfile, prefixed with a #. I wouldn't recommend doing this with images you're building for Linux hosts:
# escape=`
# Example Dockerfile with escape character changed
FROM windowsservercore
COPY testfile.txt c:\
RUN dir c:\
I know that , we can copy files from host to another from mac using finder/smb protocol.
But I would like to copy files from mac to windows machine using command line. so that, I can call the same pro-grammatically.
Could anyone please guide?
If you can copy the files using the Finder then you have connected to the SMB share. Usually, you can see this from the command line by looking in the /Volumes folder; if it doesn't look like it's there, try running the mount command to see other places things might be connected. The following assumes the SMB is mounted in /Volumes, adjust as necessary for your particular case.
On the command line, issue the command:
ls /Volumes
You should see the SMB share listed along with some other names.
Then to copy files to it:
cp myfiles/* /Volumes/MySMBShare/mydirectory
If the name of the share has spaces in it you will need to escape them with backslashes like so:
cp myfiles/* /Volumes/My\ SMB\ Share/mydirectory