Closed mendacus closed 3 months ago
Hey @mendacus, Docker encountered an error during the build when it couldn't find a file it needed. Make sure you are running the install
command in the Ghostwriter directory.
You should be able to run this command in your current directory and see this file list:
$ ls ./compose/production/postgres/maintenance
_sourced backup backups restore
Hi @chrismaddalena,
Apologies for the delayed response. I have confirmed that I am running from the expected directory in accordance to your command.
PS D:\redteam\tools\Ghostwriter-4.0.7> ls ./compose/production/postgres/maintenance
Directory: D:\redteam\tools\Ghostwriter-4.0.7\compose\production\postgres\maintenance
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2/7/2024 1:44 PM _sourced
-a---- 2/7/2024 1:44 PM 818 backup
-a---- 2/7/2024 1:44 PM 392 backups
-a---- 2/7/2024 1:44 PM 1828 restore
Immediately after this, I attempt the install.
PS D:\redteam\tools\Ghostwriter-4.0.7> .\ghostwriter-cli.exe install
[+] Checking the status of Docker and the Compose plugin...
[+] Starting production environment installation
[*] Generating new `ghostwriter.crt` and `ghostwriter.key` files
[!] Found existing certificate files, so new ones will not be generated...
[*] Rename or delete ssl/ghostwriter.key and ssl/ghostwriter.key if you want to replace these keys[*] Skipping DH params because D:\redteam\tools\Ghostwriter-4.0.7\ssl\dhparam.pem already exists
2024/02/07 13:54:56 http2: server: error reading preface from client //./pipe/docker_engine: file has already been closed
2024/02/07 13:54:56 http2: server: error reading preface from client //./pipe/docker_engine: file has already been closed
#0 building with "default" instance using docker driver
#1 [redis internal] load build definition from Dockerfile
#1 transferring dockerfile: 57B 0.0s done
#1 DONE 0.0s
#2 [postgres internal] load build definition from Dockerfile
#2 transferring dockerfile: 275B done
#2 DONE 0.0s
#3 [postgres internal] load metadata for docker.io/library/postgres:11.12
#3 DONE 0.4s
#4 [redis internal] load metadata for docker.io/library/redis:6-alpine
#4 DONE 0.4s
#5 [postgres internal] load .dockerignore
#5 transferring context: 566B done
#5 DONE 0.0s
#6 [redis internal] load .dockerignore
#6 transferring context: 566B 0.0s done
#6 DONE 0.0s
#7 [postgres internal] load build context
#7 transferring context: 2B done
#7 DONE 0.0s
#8 [postgres 2/3] COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance
#8 ERROR: failed to calculate checksum of ref 01df219c-e8b7-4266-9f84-f3df7ee1cb74::vbsilh6mc254wua44sa8gewcn: failed to walk /var/lib/docker/tmp/buildkit-mount3631553763/compose/production/postgres: lstat /var/lib/docker/tmp/buildkit-mount3631553763/compose/production/postgres: no such file or directory
#9 [postgres 1/3] FROM docker.io/library/postgres:11.12@sha256:13e23e5f97a42286c5703691e2fbad0806970bd13121fe7c28f32349ee0cf917
#9 resolve docker.io/library/postgres:11.12@sha256:13e23e5f97a42286c5703691e2fbad0806970bd13121fe7c28f32349ee0cf917 0.0s done
#9 sha256:13e23e5f97a42286c5703691e2fbad0806970bd13121fe7c28f32349ee0cf917 1.22kB / 1.22kB done
#9 sha256:ced2df470c455d54414cd5b1cac46980781b5172e6f2abcc172510aa931477c1 3.04kB / 3.04kB done
#9 sha256:48dea8832b955ddc5373f087a538213a07df9b9fb558c6218ecaa0b20aac1e98 10.35kB / 10.35kB done
#9 CANCELED
#10 [redis 1/1] FROM docker.io/library/redis:6-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5
#10 resolve docker.io/library/redis:6-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5 0.0s done
#10 sha256:cd67e73ee8d945f3974e2054b0fe6b309a721bf13dbc1e4891afd5007d279f0c 2.24kB / 2.24kB done
failed to solve: failed to compute cache key: failed to calculate checksum of ref 01df219c-e8b7-4266-9f84-f3df7ee1cb74::vbsilh6mc254wua44sa8gewcn: failed to walk /var/lib/docker/tmp/buildkit-mount3631553763/compose/production/postgres: lstat /var/lib/docker/tmp/buildkit-mount3631553763/compose/production/postgres: no such file or directory
#10 sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5 7.23kB / 7.23kB done
#10 sha256:b6c412dc298714b5c26feca1330d8f743b48caf0b1feeadfd554d7d446f985a5 8.39kB / 8.39kB done
#10 CANCELED
------
> [postgres 2/3] COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance:
------
[-] Error from `docker`: exit status 17
2024/02/07 13:54:57 Error trying to build with production.yml: exit status 17
I also attempted to navigate to the Ghostwriter/ghostwriter directory for the install to make sure I accounted for my proposed self-introduced error. This resulted in the same issue.
Please let me know if I am overlooking something, I very well could be. But based from your response, I think I followed your instructions.
Thanks for checking that. The files are there so Docker should be able to find them. What permissions are on those files and the other contents under the Ghostwriter-4.0.7 directory?
If you try building the containers with a console opened under with admin privileges does it work?
Hello,
I have the same issue as him.
I managed to solve it by modifying 2 files :
build:
context: ./compose/production/postgres
dockerfile: ./Dockerfile
COPY maintenance /usr/local/bin/maintenance
I am not enough an expert on Docker (especially on Windows), so it would be hard for me to explain it why it worked in this way and not the other.
Thanks for the comment. The context: .
should set the build context for Docker Compose to the current working directory (e.g., C:\\Some\Directory\Ghostwriter\). Then Compose looks for the necessary files starting from that context. Maybe the working context behaves a little differently on Windows. I'll have to setup a Windows system to test that with different versions.
This issue has been labeled as stale
because it has been open for 30 days with no activity.
This issue is closed because it has been inactive for 14 days since being labeled stale
. Feel free to re-open the issue with a comment. If this needs further discussion (e.g., a feature request), it might be better to open a topic under the Discussions tab.
Describe the bug Following the quickstart guide, I run into an error at
postgres 2/3
while installing Ghostwriter.To Reproduce Steps to reproduce the behavior:
Expected Behavior An expectation of Ghostwriter to be installed. From the quickstart guide, it seemed straightforward.
Screenshots
Server Specs:
Server: Docker Desktop 4.27.1 (136059) Engine: Version: 25.0.2 API version: 1.44 (minimum version 1.24) Go version: go1.21.6 Git commit: fce6e0c Built: Thu Feb 1 00:23:17 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.28 GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker Compose version v2.24.3-desktop.1