How to Access File Syetm of a Docker running on Linux Machine - linux

I am working on a web application developed on .net core 2.0 and the same is hosted on a Linux machine (Fedora OS) using docker image.
The application has a document manager, which is storing and reading files from an external source(a network share / physical path on the base machine). This was working fine on normal dev environment and windows machines.
Please advice, how to get the file system / file path on Linux system with Docker.
var pathFolder = "E:\\DocLib\\";
var filePath = pathFolder + "\\" + newFileName;

Related

command to pass username and password to ibm staf/stax application

STAF/STAX application works in a way that if the staf service is running in a windows machine then from a linux machine where staf is configured and if both the windows machine and linux machine are communicating each other then from linux machine by using staf we can execute commands in windows machine without passing any credentials but there is a shared folder which is accessible from windows machine but when trying from linux machine it is saying "Access is denied". in order to grant access from windows machine a user need to created and the user is also created but how to pass that user credentials to authenticate with that windows machine and access the shared folder using IBM STAF application.
this is working
/usr/local/staf/bin/staf process start shell command "ipconfig" WAIT STDERRTOSTDOUT RETURNSTDOUT
this is not working
/usr/local/staf/bin/staf process start shell command "copy "/shared_path_folder/file.txt" "/destination_path/file.txt"" WAIT STDERRTOSTDOUT RETURNSTDOUT

DVC Shared Windows Directory Setup

I have one Linux machine and one Windows machine for developments. For data sharing, we have set up a shared Windows directory in another Windows machine, which both my Linux and Windows can access.
I am now using DVC for version control of the shared data. To make it easy, I mount the shared Windows folder both in Windows and in Linux development machine. In Windows, it looks like
[core]
analytics = false
remote = remote_storage
['remote "remote_storage"']
url = \\my_shared_storage\project_dir
In Linux, it looks like:
[core]
analytics = false
remote = remote_storage
['remote "remote_storage"']
url = /mnt/mount_point/project_dir
As you can see, Windows and Linux have different mounting points. So my question is: is there a way to make that both Windows and Linux have the same ùrl in the DVC configuration file?
If this is impossible, is there another alternative solution for DVC keeps data in remote shared Windows folder? Thanks.
If you are using a local remote this way, you won't be able to have to the same url on both platforms since the mount points are different (as you already realized).
The simplest way to configure this would be to pick one (Linux or Windows) url to use as your default case that gets git-committed into .dvc/config. On the other platform you (or your users) can override that url in the local configuration file: .dvc/config.local.
(Note that .dvc/config.local is a git-ignored file and will not be included in any commits)
So if you wanted Windows to be the default case, in .dvc/config you would have:
[core]
analytics = false
remote = remote_storage
['remote "remote_storage"']
url = \\my_shared_storage\project_dir
and on your Linux machine you would add the file .dvc/config.local containing:
['remote "remote_storage"']
url = /mnt/mount_point/project_dir
See the DVC docs for dvc config --local and dvc remote modify --local for more details:
https://dvc.org/doc/command-reference/config#description
https://dvc.org/doc/command-reference/remote/modify#command-options-flags

Access shared folder using a specific windows credential

I'm currently working with a requirement: download a file from the database then write it to a shared folder. Temporarily, I'm working on a path on my local:
File.WriteAllBytes(path, content);
My problem is the shared folder is on a windows machine and only a specific account will be allowed to write to this folder.
Now I know the basics of Impersonation but I don't know if it is possible to impersonate on a Docker container on a Linux machine.
In short, I want to deploy my application on a Linux container then write a file to a windows shared folder with limited access.
Is the folder on the host or mounted on the host? If so you can then map the host folder to the container. e.g.
C:\> "Hello" > c:\temp\testfile.txt
C:\> docker run -v c:/temp:/tmp busybox cat /tmp/testfile.txt
c:/temp being a local path on the host
/tmp being the path in the container.
More details here: volume-shared-filesystems

Deploy war file in tomcat using Linux

I am using Red Hat Enterprise Linux Server release 5.1 (Tikanga) and apache-tomcat-6.0.35.tomcat install on port 8080 than i change in 80(default) . Using tomcat deploy war file(abc.war) successfully but i want to access this application as (www.abc.com). plz suggest how to replace index file(ROOT)??
Two things:
You need to pay for a domain name and point it at your IP address.
Create (or symlink) your application's .xml file to ROOT.xml in the webapps directory. This will mean you can access the application using '/' as well as '/abc'.

how to translate windows folder path to linux folder path

I have an application running on linux which reads image file path from db and show it... similarly there is another windows based application which reads the same db for image file path and shows it. I have configured the SMB service to share the folder with windows...
The problem is that when the linux app stores the image path it uses the path as /data/images/file.tip and windows app cannot read this file because the path is not absolute... same is the case if windows app modifies the db it uses \server\images etc.,
how do i translate windows path to linux and vice versa...
In your application, can you not specify an OS Flag/Variable, and only store the image file name.
Then based on OS, look in XXX folder for that file.
So store "Image.jpg" in DB, and on the Windows App open "C:\Image.jpg" and on Linux open "/home/user/Image.jpg"
The / and \ are OS specific, so when you retrieve a data from database, try first to replace / with \ if you are in windows, or \ with / if you are on windows.

Resources