Skip to main content

Featured

Build docker image from multiple build contexts

Build docker image from multiple build contexts Building a docker image requires specifying a source of truth to include in the image from a local directory or a remote git repository. In the previous version, the docker BuildKit allows users to specify the build context from a single source of truth only. However, the engineers may need to have the context from different locations based on the type of files. For instance, icons, images or other resources that are not included in the same package, including the resource from other docker images. Fortunately, the Docker Buildx toolkit supports multiple build context flag for Docker 1.4. Let's learn how to use this new feature. The following list is a shortcut for jumping into a specific topic handy. What version of Docker is this tutorial targeting? How to specify the version of Dockerfile frontend? Ho

[Win]Service存取網路磁碟

目前測試在要進行存取時,先呼叫LogonUser()
之後就可以用所輸入的使用者帳號來存取網路磁碟了。

存取完後需使用CloseHandle()來關閉Token並釋放記憶體即可。

dwLogonType設成 LOGON32_LOGON_INTERACTIVE或是LOGON32_LOGON_NEW_CREDENTIALS則都可以。

只是網路磁碟的路徑要使用UNC路徑才行,不然還是一樣會找不到路徑。

mapping過的路徑目前測試結果是service是一定讀不到檔案,原因則目前不明。

如有需讀取mapping路徑內之資料,請參考[Win]Mapping Disk的紀錄位置

PS.如有需要讓呼叫的執行檔也有同樣的權時,dwLogonType需設成LOGON32_LOGON_INTERACTIVEdwLogonProvider則要設為LOGON32_PROVIDER_DEFAULT

之後再使用 CreateProcessAsUser()來執行執行檔即可。需傳入的Token則為先前使用LogonUser()所取得的token。

Comments

Popular Posts