Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

freemanx's avatar

How to push Laravel app to docker hub after using Laravel Sail

Hello, I want to push my project image to docker hub, I used laravel sail but I read that it is only for local environment

My project: Laravel + mysql

Does anyone have a tutorial or configuration example that could help me do this please?

0 likes
5 replies
Sinnbeck's avatar

First off I'm curious as to why? Normally you just include your docker files in the project so the next developer can use it. And did you change each Dockerfile alot?

And be aware that docker hub is for single images. So you need to add each service to docker hub (the Dockerfile).

freemanx's avatar

@Sinnbeck in fact it's a school project and the teacher asks for the link of the image on dockerhub Since I'm not used to using docker after reading some documentation on docker, I thought I could create an image of the project.

Sinnbeck's avatar

@freemanx ah so he expects a single Dockerfile that includes both php, mysql and the source code for the project?

freemanx's avatar

@Sinnbeck ok i see, docker hub is hosting the image having only one Dockerfile, i can't host one image from docker-compose.yml it's several images

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@freemanx exactly yes. That's why you normally ship your docker-compose.yml + docker files with your source code. Then people just need to run 1 command and they are up and running :)

1 like

Please or to participate in this conversation.