docker image created with nix – how to load on Windows? - windows

We're getting
C:\Users\Alice\Downloads> docker load -i
.\demccqjb91lx4ycymhg0rp9q3fd8zx65-docker-image-foo.tar.gz
open /var/lib/docker/tmp/docker-import-2092215042/repositories: no
such file or directory
when trying to load a docker image created with a simple regular nix-build docker.nix (as in https://github.com/bradparker/haskell-on-heroku ).
If we try docker import instead of docker load, it seems to load but then on docker run it says docker: Error response from daemon: No command specified.
Is there some special ceremony needed for Windows deployment?

Related

Enabling DOCKER_CONTENT_TRUST causes docker & docker-compose commands to fail

a. Run the below export command in terminal:
export DOCKER_CONTENT_TRUST=1
b. Run :
docker-compose up --build -d
FAILURE:
ERRO[0000] Can't close tar writer: io: read/write on closed pipe
error during connect: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.41/build?buildargs=%7B%22EIS_VERSION%22%3A%222.4%22%2C%22GO_VERSION%22%3A%221.12%22%2C%22HOST_TIME_ZONE%22%3A%22Asia%2FKolkata%22%2C%22HTTPS_PROXY%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22HTTP_PROXY%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22NO_PROXY%22%3A%22127.0.0.1%2Clocalhost%22%2C%22UBUNTU_IMAGE_VERSION%22%3A%2218.04%22%2C%22http_proxy%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22https_proxy%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22no_proxy%22%3A%22127.0.0.1%2Clocalhost%22%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=dockerfiles%2FDockerfile.eisbase&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=ia_eisbase%3A2.4&target=&ulimits=null&version=1: invalid reference format
Sending build context to Docker daemon 12.55kB
I think DOCKER_CONTENT_TRUST locks some file wrt docker which causes this error.
docker-compose does not have any support for image signing or image signature verification.
— https://github.com/sse-secure-systems/trusted-compose
You need to implement a wrapper for docker-compose or use an existing one in order to work with content trust and docker-compose.
I don't use personnaly trusted-compose but it looks like as a good solution: https://github.com/sse-secure-systems/trusted-compose.
Additional resources:
Bringing Content Trust into the World of docker-compose (medium.com)
Docker Compose not using trusted content during pull (https://github.com/docker/compose)

Why is Podman trying to pull an image that already exists after loading from file?

I am working in an air-gapped environment running Fedora CoreOS which comes packaged with Podman. I have several container images I have been working on transporting into the air-gapped environment. In order to do this I have followed these steps:
I acquired the images on a machine with internet access. Some of the images were pulled into Podman from my Docker registry using podman pull docker-daemon:docker.io/my-example-image:latest while some were pulled directly from the online repositories using podman pull.
I saved the images to a tar file using (for example) podman save docker.io/my-example-image:latest -o my-example-image.tar
I transported the tar files to the air-gapped environment on physical media and loaded them using podman load -i my-example-image.tar
When I check the images using podman images they all appear in the images list. However, if I try to run a container from one of these images, using sudo podman run docker.io/my-example-image I get a long error message:
Trying to pull docker.io/my-example-image
Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on [::1}:53: read udp [::1]:50762 ->
[::1]:53: read: connection refused
Error: unable to pull docker.io/my-example-image: Error initializing source docker://my-example-image:latest:
error pinging docker registry registry-1.docker.io: Get "https://registry-1.docker.io/v2/": dial tcp: lookup
registry-1.docker.io on [::1]:53: read udp [::1]50762 -> [::1]:53: read: connection refused
I get a similar message for images that were acquired from other repositories like quay.io
It seems to me that the error is caused by the machine's inability to establish a connection with a registry, which makes sense to me considering that the environment is air-gapped. But I am not sure why podman is even trying to pull these images when they already exist in the environment as confirmed by podman images
I have tried using various ways of referencing the image within the podman run command including
sudo podman run docker.io/my-example-image:latest
sudo podman run my-example-image
sudo podman run my-example-image:latest
I have tried searching for a solution to this problem to no avail and would very much appreciate any guidance on this.
Each user has its own container storage.
The user root uses the directory /var/lib/containers/
Normal users use the directory ~/.local/share/containers/
The command
podman load -i my-example-image.tar
will use the directory ~/.local/share/containers/
The command
sudo podman run docker.io/my-example-image
will use the directory /var/lib/containers
If you would like to share a read-only container storage between users,
check out the setting additionalimagestores in the file storage.conf
[storage.options]
additionalimagestores = [ "/var/lib/mycontainers",]
Reference:
https://www.redhat.com/sysadmin/image-stores-podman

docker :manifest for microsoft/windowsservercore:latest not found

I want to run IIS in my Docker container
But when I write this command :
docker pull microsoft/windowsservercore
I get this error :
Using default tag: latest
Error response from daemon: manifest for microsoft/windowsservercore:latest not found
Microsoft has deprecated the latest tag
https://techcommunity.microsoft.com/t5/Containers/Removing-the-latest-Tag-An-Update-on-MCR/ba-p/393045
the official image with latest tag is
docker run mcr.microsoft.com/windows/servercore:ltsc2019
While using the docker pull command "docker run mcr.microsoft.com/windows/servercore:ltsc2019below".
I am getting this error "docker: Error response from daemon: open \.\pipe\docker_engine_windows: The system cannot find the file specified."

"OCI runtime create failed " issue running script on MacOS using Docker host

I'm trying to run pishrink on MacOS using a Docker host, as explained here. The pishrink script shrinks the size of an .img so it's quicker to burn onto an SD card.
I have Docker Desktop running, and I've add the repo to the top-level in my file system (/pishrink) and and running the following command:
docker-compose run pishrink /pishrink/pishrink.sh /pishrink/big-image.img /pishrink/small-image.img
When I do, I get the following error:
Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"/pishrink/pishrink.sh\": permission denied": unknown
Can someone help me debug this issue? I'm relatively new to using Docker so I might be making some simple + fundamental mistakes.
I was able to fix this with the following command, using sudo as suggested:
sudo docker-compose run pishrink /pishrink/pishrink.sh /pishrink/big-image.img /pishrink/small-image.img

Unable to download any image in Windows16 docker

I have been experimenting with docker the aim is
Install docker on windows 16
for which I am following instructions from https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start_windows_server
everything looks fine till installation of the docker , after that when I try to test the docker it give
below error.
failed to register layer: re-exec error: exit status 1: output: ProcessBaseLayer C:\ProgramData\docker\windowsfilter\0c9
effd422805350acb1f051eb171399678aff003192c41be274acc4762b786c: The system cannot find the path specified.
here I am just trying to pull "hello-world" from docker hub
My ultimate aim is to run IIS on docker container and deploy the application running on IIS.
Had anyone faced such issue or could come up with any suggestions
its VM machine with
OS :- Win2016
HDD :- 50GB
RAM :- 4GB
You can't pull the hello-world image from docker hub because it's linux image. I used to see it before while playing with Docker Container on windows when trying to do the same thing.
If you want to get different image like IIS, just run command follow the instructions:
First:
Install-PackageProvider ContainerImage -Force
Then
Install-ContainerImage -Name WindowsServerCore
After that, restart your docker container with
Restart-Service docker
And you'll have the images of IIS on your machine.
I've tried to get the images of windows as the way we do in Linux but it always throw error as you have, I guess that all images we have on hub now are for Linux only, so if you want to have particular things, you must build it by yourselves or using existed images for Windows on Docker hub (about 9 or 10 images as I remember).
This is probably because there's no hello-world image for Windows. You can try running docker run windowsservercore cmd /C hello world.

Resources