How to import docker image from local machine into plesk
Asked Answered
A

3

10

I have small API app written in node.js and i want to run in docker on plesk. I successfully create image and run in container on local docker machine. I have Plesk Onyx 17.5.3 with docker extension in version: 1.3.1-126. And now I`m not sure how to run this my image run in plesk.

I tried:

1) With command docker save -o output-path image-name export image to .tar file. enter image description here 2) This .tar file upload on plesk to docker extension. enter image description here 3) After upload create image name "sha256:038a9". BTW: My name of docker image is wapi. enter image description here 4) And if i use "Run (local)" so i can`t set port mapping. After click on OK button show Error: {"message":"No command specified"} enter image description here

Can you somebody help me, please?

PS: If you want see anything (dockerfile etc.) so write it. :)

dockerfile

FROM node:7
WORKDIR /app
COPY package-lock.json .
COPY package.json .
RUN npm install
COPY /dist .
CMD npm run docker_start
Archaize answered 20/12, 2017 at 13:40 Comment(5)
yes can you show dockerfile?Inarticulate
@sanathmeti done. But i say, application is running ok on local docker.Loch
FYI: You can`t set port mapping because automatic port mapping is checked in your picture.Demetrius
@Demetrius Yes, i know, but if i uncheck, so nothing happened. This is i mean.Loch
I have exactly the same problem. Sadly there seems to be no solution to this? We can also not use Dockerhub (especially public one!).Duyne
P
6

Plesk Docker Workaround: Upload your Docker-Image with FTP. Than use a shell and run the command "docker load -i [yourimagefile.tar]" to deploy the image in the repository of the PLESK-Server. After this you can use your image under PLESK without pain;)

Petuntse answered 10/11, 2020 at 20:49 Comment(0)
I
0

That because docker image is been loosing the CMD or ENTRYPOINT metadata information while doing

docker export 

docker import

Its been discussed here

https://github.com/moby/moby/issues/8334

You can publish your image to dockerhub ( private/public ) then import that in plesk.

Inarticulate answered 20/12, 2017 at 14:26 Comment(5)
Thanks for your answer, but "docker export" export a container’s filesystem, not image. via: docs.docker.com/engine/reference/commandline/exportLoch
I used "docker save" to export image from local.Loch
BTW i used export, but it is the same!Loch
yes in that process it skipped the CMD / ENTRYPOINT metadata, you can have try with dockerhubInarticulate
we need a solution without dockerhubBeckford
D
-1

There are few ways to export/import containers and images.

Export container

docker export container-name | gzip > Zip_File_Name.gz

Import container

zcat Zip_File_Name.gz | docker import - container-name

Docker save container/image in zip file

docker save -o Zip_File_Name.tar container_name

Docker load image from zip file

docker load -i Zip_File_Name.tar
Dextrin answered 20/12, 2017 at 15:17 Comment(1)
this comment was useful, but not the right solution I thinkPirbhai

© 2022 - 2025 — McMap. All rights reserved.