Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ Run docker command from console.

## Building for source
- Install mingw https://www.mingw-w64.org/

##### Library Dependency
- [curl](https://curl.se/)
- [pthreads](https://github.com/fwbuilder/pthreads4w)
##### Tips
1. Put all libs into `mingw64/x86_64-w64-mingw32`

- Add bin folder to path
- Clone the repository
- Run compile.bat
Expand Down
9 changes: 9 additions & 0 deletions compile.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
@ECHO off

set folderPath=".\gui\obj"

if not exist %folderPath% (
mkdir %folderPath%
echo gui obj folder created successfully.
) else (
echo gui obj folder already exists.
)

windres -i .\gui\resources.rc -o .\gui\obj\resources.o

cd setup
Expand Down
1 change: 1 addition & 0 deletions gui/inc/elem.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "../../common/common.h"

#define WM_NOTIFYCALLBACK 0x8001
#define NOTIFYICON_VERSION_4 4

HICON load_icon(HINSTANCE hinst, const char *path);
HWND create_main_window(LPCSTR lpClassName, LPCSTR lpWindowName, HINSTANCE hInstance, LPVOID lpParam);
Expand Down
34 changes: 18 additions & 16 deletions gui/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <windows.h>
#include "./inc/thread.h"
#include "gui.h"

#define APPLICATION_NAME "Docker CLI"
Expand Down Expand Up @@ -133,28 +134,29 @@ void ShowContextMenu(HWND hwnd, POINT pt)

LRESULT CALLBACK windowProc(HWND hwnd, UINT u_msg, WPARAM w_param, LPARAM l_param)
{
POINT pt; // = { LOWORD(w_param), HIWORD(w_param) };
switch (u_msg) {
case WM_CREATE:
// here should be the initialization process
break;
case WM_NOTIFYCALLBACK:
switch (LOWORD(l_param)) {
case WM_LBUTTONDBLCLK:
ShowWindow(hwnd, SW_SHOW);
break;
case WM_CONTEXTMENU:
POINT pt; // = { LOWORD(w_param), HIWORD(w_param) };
GetCursorPos(&pt);
#ifdef __DEBUG
printf("x: %d - y: %d\n", pt.x, pt.y);
#endif
ShowContextMenu(hwnd, pt);
break;
default:
#ifdef __DEBUG
printf("X %d\n", LOWORD(w_param));
printf("Event %d\n", LOWORD(l_param));
#endif
case WM_LBUTTONDBLCLK:
ShowWindow(hwnd, SW_SHOW);
break;
case WM_CONTEXTMENU:
GetCursorPos(&pt);
#ifdef __DEBUG
printf("x: %d - y: %d\n", pt.x, pt.y);
#endif
ShowContextMenu(hwnd, pt);
break;
default:
#ifdef __DEBUG
printf("X %d\n", LOWORD(w_param));
printf("Event %d\n", LOWORD(l_param));
#endif
break;
}
break;
case WM_CLOSE:
Expand Down
1 change: 1 addition & 0 deletions gui/src/elem.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ DOCKERCLI_CODE create_tray_icon(HWND hwnd)
return DOCKERCLIE_SYSTEM;

nicon.uVersion = NOTIFYICON_VERSION_4;
// nicon.uVersion=4;
status = Shell_NotifyIconA(NIM_SETVERSION, &nicon);
if (!status)
return DOCKERCLIE_SYSTEM;
Expand Down
2 changes: 1 addition & 1 deletion gui/src/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void *daemon_start(void *args)
return NULL;
}

DOCKERCLI_CODE daemon_init(const char *path, char *args, pthread_t *tid)
DOCKERCLI_CODE init_daemon(const char *path, char *args, pthread_t *tid)
{
char daemon_path[MAX_PATH];

Expand Down
5 changes: 5 additions & 0 deletions installer/src/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ void get_fs(void)
char errbuff[CURL_ERROR_SIZE];
curl_easy_setopt(curl, CURLOPT_URL, FS_URL);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuff);

//Do not use CA verify
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);


#ifdef __DEBUG
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
#endif
Expand Down
10 changes: 5 additions & 5 deletions installer/src/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static int mk_folders(const char *base_path)
static int copy_docker(const char *base_path)
{
char cp_cmd[MAX_CMD_LEN];
sprintf(cp_cmd, "%s %s%s", "cp -r ..\\..\\init\\bin\\docker-cli-init", base_path, "\\docker-cli\\bin\\");
sprintf(cp_cmd, "%s %s%s", "copyx ..\\..\\init\\bin", base_path, "\\docker-cli\\bin\\");

int status = DOCKERCLIE_OK;
status = exec(cp_cmd);
Expand All @@ -83,7 +83,7 @@ static int copy_docker(const char *base_path)
static int copy_daemon(const char *base_path)
{
char cp_cmd[MAX_CMD_LEN];
sprintf(cp_cmd, "%s %s%s", "cp ..\\..\\daemon\\bin\\dockerd", base_path, "\\docker-cli\\daemon\\");
sprintf(cp_cmd, "%s %s%s", "copyx ..\\..\\daemon\\bin", base_path, "\\docker-cli\\daemon\\");

int status = DOCKERCLIE_OK;
status = exec(cp_cmd);
Expand All @@ -94,7 +94,7 @@ static int copy_daemon(const char *base_path)
static int copy_bin_cli(const char *base_path)
{
char cp_cmd[MAX_CMD_LEN];
sprintf(cp_cmd, "%s %s%s", "cp -r ..\\..\\cli\\bin\\docker", base_path, "\\docker-cli\\cli\\");
sprintf(cp_cmd, "%s %s%s", "copyx ..\\..\\cli\\bin", base_path, "\\docker-cli\\cli\\");

int status = DOCKERCLIE_OK;
status = exec(cp_cmd);
Expand All @@ -105,7 +105,7 @@ static int copy_bin_cli(const char *base_path)
static int copy_assets(const char *base_path)
{
char cp_cmd[MAX_CMD_LEN];
sprintf(cp_cmd, "%s %s%s", "cp ..\\..\\assets\\settings.ico", base_path, "\\docker-cli\\");
sprintf(cp_cmd, "%s %s%s", "copyx ..\\..\\assets\\settings.ico", base_path, "\\docker-cli\\");

int status = DOCKERCLIE_OK;
status = exec(cp_cmd);
Expand Down Expand Up @@ -177,7 +177,7 @@ int install(const char *base_path)
return DOCKERCLIE_CANNOTIFS;
*/

edit_dns();
// edit_dns();
copy_start_scripts();

/* terminate vm to set changes */
Expand Down