Unable to install windowsServerCore Container Image - docker

I am trying to install windowsServercore images on my WIndows 2016 server using below command.
Install-containerImage WindowsServerCore
while running it got below error message.
Install-ContainerOSImage : The term 'Install-ContainerOSImage' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Found there is a work around from article
https://social.msdn.microsoft.com/Forums/en-US/fc571caf-af13-45ed-a021-cfcfcf532645/the-term-installcontainerosimage-is-not-recognized-as-the-name-of-a-cmdlet-on-build-build-14385?forum=windowscontainers
While running the commands from the new article, getting different error message.
docker load -i nanoserver.tar.gz
58684737b3d1: Loading layer [==================================================>] 358.4 MB/358.4 MB
re-exec error: exit status 1: output: ProcessBaseLayer C:\ProgramData\docker\windowsfilter\dc41572502daedc9c628b56d1f369
ee804e901159b053d5e082e31e339ae822d: A required certificate is not within its validity period when verifying against the
current system clock or the timestamp in the signed file.
My system time is correct and i am running Windows 2016 server on AWS.
Any help to fix this issue is appreciated.

You can use bellow command to pull the image to your docker host which is windows server 2016:
docker pull microsoft/windowsservercore

Use the following command:
docker run -t -i mcr.microsoft.com/windows/nanoserver:1809
This will load Nano Server from the official Microsoft DockerHub repository:
https://hub.docker.com/_/microsoft-windows-nanoserver

Related

Docker daemon access denied while running from github actions

i am currently trying to setup the Github - actions and use windows VM as build server (self hosted runner). i have installed docker on windows.
i am able to connect to our harbor regisrty from windows VM
example screenshot from powershell : Able to successfully run the docker command in windows VM
but, when i try to execute the same command from github actions, i am getting access denied error
please refer the following screenshot from github-actions :
Access denied error when running docker command from github actions
can someone help me here?
I had to modify the startup params of the Docker Engine service to point to the User group installed with the Github actions runner. I also had to make this modification using the registry editor as the GUI for the services would not accept a parameter change, more on this here: https://serverfault.com/questions/507561/in-a-windows-service-will-the-start-parameters-be-preserved-if-the-start-is-of
Example: "C:\Program Files\Docker\dockerd.exe" --run-service -G GITHUB_ActionsRunner_XXXXXX"

foundationdb running docker image macos database unavailable

I am trying to run foundation db using a docker image in Macos as below.
docker run --init --rm --name=fdb-0 foundationdb/foundationdb:6.2.22
Starting FDB server on 172.17.0.2:4500
This seems to start. But then I connect to fdb cli after logging into the container I get the following error statuses.
docker exec -it fdb-0 /bin/bash
root#9e8bb6985be5:/var/fdb# fdbcli
Using cluster file `/var/fdb/fdb.cluster'.
The database is unavailable; type `status' for more information.
Welcome to the fdbcli. For help, type `help'.
fdb> status
Using cluster file `/var/fdb/fdb.cluster'.
The coordinator(s) have no record of this database. Either the coordinator
addresses are incorrect, the coordination state on those machines is missing, or
no database has been created.
172.17.0.2:4500 (reachable)
Unable to locate the data distributor worker.
Unable to locate the ratekeeper worker.
I saw this issue https://forums.foundationdb.org/t/fdbcli-access-external-docker/1069. But, could not successfully run in host network as well. Any help would be appreciated.
Try running fdbcli with fdbcli --exec "configure new single memory ; status". This will start the new database with single redundancy memory mode.

Docker volume mount windows container

I am getting the following error while trying to mount a volume in windows docker container.
===============
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: container 1234567ebcdh encountered an error during Start: failure in a Windows system call: The compute system exited unexpectedly. (0xc0370106)
================
I have mentioned almost all the possible combinations of c:/app in docker file but still getting error while starting the container itself without -v option.
-----------
FROM microsoft/windowsservercore
SHELL ["powershell", "-Command"]
WORKDIR /application
COPY . .
VOLUME C:/application
CMD cmd
-----------
OS: Windows 10
Docker: Docker for windows 2.0.0
If you have any idea what went wrong here?
This seems to be followed with docker/for-win issue 676 which includes:
I was also having this exact issue:
docker: Error response from daemon: container XYZ encountered an error during Start: failure in a Windows system call: The compute system exited unexpectedly. (0xc0370106).
I found 2 solutions for my case:
I was able to successfully build and run the image by reducing the number of layers in the history. (For me this number happened to be a max of 37 layers in history.) (If your dockerfile is based on a 2nd dockerfile, you may need to reduce the number of steps in the 2nd dockerfile.)
How to debug: I was able to debug this by cutting the number of steps in half until the image ran, then re-adding steps until I discovered how many steps the history could have before breaking the image.
I was able to successfully build and run the image without reducing the number of layers by making sure that the root image was a certain version of windowsservercore:1709 (specifically, the 10.0.16299.904_en-us version of 1709, which does not appear to be pull-able anymore; however, it might also work with the latest version of windowsservercore:1709, I haven't tried).
I didn't debug this, I discovered this by blind luck.
Note: the same issue reports that mounting can be problematic.

Cannot run JHipster docker

Im trying to run https://hub.docker.com/r/jhipster/jhipster/ as part of a Jenkins build on OpenShift, with CentOS host, but am getting the following error:
Failed to start container with docker id 38194274e387 with error:
Error response from daemon:
{"message":"invalid header field value \"oci runtime error: container_linux.go:247:
starting container process caused \\\"chdir to cwd (\\\\\\\"/home/jenkins/workspace/copy-of-sw\\\\\\\") set in config.json failed: no such file or directory\\\"\\n\""}
The dockerfile contents can be viewed on https://hub.docker.com/r/jhipster/jhipster/~/dockerfile/
Does anyone know how to resolve this?
For a Jenkins build, you want to use the CI image jhipster/jhipster-ci-stack https://hub.docker.com/r/jhipster/jhipster-ci-stack/
That Docker image jhipster/jhipster is used for developing with the generator, it will not work correctly in a Jenkins pipeline unless you are changing the generator and want to test that. How to use that image can be found in the "Docker installation (for advanced users only)" of https://jhipster.github.io/installation/

can't build the docker image with error saying image not found

I am trying to build a docker image from public repository. Actually I had built it successfully before, today I wanted to update the image to latest one, so I removed the older image, and tried to pull the new image.
However, when I tried
$ docker pull dockerfile/ghost
Pulling repository dockerfile/ghost
FATA[0001] Error: image dockerfile/ghost:latest not found
I can't really understand why it doesn't work, it is supposed to be working.
This is what you need
Use docker pull ghost.
Thanks, #Chandan. I followed his advice to find the problem through
docker logs container_id
Firstly, the error is
ERROR: casper cannot be activated because it is not currently
installed.
so I downloaded the casper and put it into the theme folder.
Secondly, the error is
Migrations: Up to date at version 003 Ghost is running in
development... Listening on 127.0.0.1:2368 Url configured as:
http://localhost:2368
because the ghost server is running in the development mode.so I make it as production mode.
Thirdly, by making it into the production mode, there is a error
ERROR: Unable to access Ghost's content path:
so I followed the instruction to edit /path/to/ghost/blog/config.js and copy the paths section from development to production. Then restart the container.
docker restart some-ghost
at last it works
Replace
docker pull dockerfile/ubuntu
with
docker pull ubuntu
Similarly in Dockerfile for base image pull, replace
FROM dockerfile/ubuntu
with
FROM ubuntu
Change ubuntu to any other image name you require

Resources