4

So I have attempted to dive into Docker and created my first image of a web app and can run it successfully.

How can I create a .deb file to send this out to people to install it on their systems?

1
  • 1
    Docker images themselves are meant to be what's distributed, they're not meant to be converted to .deb packages. You should look into publishing the image you created on docker hub. Commented Jul 5, 2021 at 3:26

2 Answers 2

4

Docker images themselves are what should be distributed. Images are not meant to be converted to .deb packages. You should look into publishing the image you created on docker hub or another container repository like Amazon Elastic Container Registry or GitHub Container Registry so people can docker pull and docker run your image.

If you don't want to use a container registry, you can always share your repository and Dockerfile so people can build it locally.

See the other answer for a more reliable way but not "best practice" method to share Docker images. These methods all require Docker be installed.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. The problem is that the people who will be using this web app will not have docker installed. Can they still run those commands without docker installed?
Sadly, no, unless they have a container compatible client like podman, Kubernetes installed. Respectfully you might want to consider a different way of distributing your application if your clients don't have Docker. Docker will be required to run the images you create with it.
1

Another way to send an image to someone - without using a registry - is to use docker save to create a file containing the image. You can then send the file to the people that need it and they can restore the image using docker load.

3 Comments

(This is the Docker equivalent of emailing individual .deb files around and using dpkg rather than apt-get to install them; I'd do it only as a last resort in situations where you can't run a Docker repository or use a pre-hosted one.)
@DavidMaze I agree. But I'd think it's more reliable than having people build the image from sources as suggested in the accepted answer.
Rebuilding from source should be completely reliable as long as the source is available. Builds are meant to be repeatable. Of course, it's accepted that source is not always going to be available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.