[{"data":1,"prerenderedAt":1385},["ShallowReactive",2],{"/environment/how-to-create-docker-image-on-docker-hub/":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"head":10,"created":25,"tags":29,"chapters":32,"thumb":34,"contact":35,"feedback":35,"lead":35,"list":35,"index":35,"sitemap":35,"featured":35,"body":36,"_type":1379,"_id":1380,"_source":1381,"_file":1382,"_stem":1383,"_extension":1384},"/environment/how-to-create-docker-image-on-docker-hub","environment",false,"","How to create Docker image on Docker Hub?","Article describes the process of creating and publishing a Docker image on Docker Hub to enhance CI/CD setup in Bitbucket Pipelines and GitHub Actions.",{"title":11,"link":12,"meta":16},"How to create Docker image on Docker Hub? | pragmate.dev",[13],{"rel":14,"href":15},"canonical","https://pragmate.dev/environment/how-to-create-docker-image-on-docker-hub/",[17,20,23,26],{"name":18,"content":19},"twitter:creator","@przemekhernik",{"name":21,"content":22},"author","Przemysław Hernik",{"name":24,"content":25},"article:published_time","2026-07-24",{"name":27,"content":28},"og:image","https://cdn.pragmate.dev/wp-content/uploads/2025/11/47cc47bd-2c36-4c8b-b2f0-3e9e65186ef3.jpg",{"time":30,"level":31},"5 min","Easy",[33],"/environment/how-to-create-docker-image-on-docker-hub/","docker",true,{"type":37,"children":38,"toc":1368},"root",[39,45,72,86,90,94,101,146,155,183,190,193,199,225,232,248,276,296,317,427,430,435,443,447,450,456,461,466,473,486,535,573,576,582,594,618,642,645,651,663,670,673,679,706,798,801,807,828,1198,1203,1210,1215,1336,1339,1362],{"type":40,"tag":41,"props":42,"children":44},"element","prose-video",{"thumbnail":28,"url":43},"https://www.youtube-nocookie.com/embed/Glb4CzFKcg0",[],{"type":40,"tag":46,"props":47,"children":48},"p",{},[49,52,61,63,70],{"type":50,"value":51},"text","Using Docker is a perfect way to simplify task automation in ",{"type":40,"tag":53,"props":54,"children":58},"a",{"href":55,"rel":56},"https://www.atlassian.com/software/bitbucket/features/pipelines",[57],"nofollow",[59],{"type":50,"value":60},"Bitbucket Pipelines",{"type":50,"value":62}," and ",{"type":40,"tag":53,"props":64,"children":67},{"href":65,"rel":66},"https://github.com/features/actions",[57],[68],{"type":50,"value":69},"GitHub Actions",{"type":50,"value":71},". It helps creating environment that is aligned with the project’s requirements, which can then be used on these platforms to define workflows.",{"type":40,"tag":46,"props":73,"children":74},{},[75,77,84],{"type":50,"value":76},"In this article, I'll discuss the process of creating and publishing a Docker image on ",{"type":40,"tag":53,"props":78,"children":81},{"href":79,"rel":80},"https://hub.docker.com/",[57],[82],{"type":50,"value":83},"Docker Hub",{"type":50,"value":85}," to enhance CI/CD configuration on Bitbucket Pipelines and GitHub Actions.",{"type":40,"tag":87,"props":88,"children":89},"cta",{},[],{"type":40,"tag":91,"props":92,"children":93},"hr",{},[],{"type":40,"tag":95,"props":96,"children":98},"h2",{"id":97},"how-to-prepare-the-environment",[99],{"type":50,"value":100},"How to Prepare the Environment?",{"type":40,"tag":46,"props":102,"children":103},{},[104,110,112,118,120,127,129,135,137,144],{"type":40,"tag":53,"props":105,"children":108},{"href":106,"rel":107},"https://hub.docker.com/explore",[57],[109],{"type":50,"value":83},{"type":50,"value":111}," is a place that Bitbucket Pipelines and GitHub Actions use to run containers in their actions. To create and share an image there, you will need a few things: an account on ",{"type":40,"tag":53,"props":113,"children":116},{"href":114,"rel":115},"https://app.docker.com/signup",[57],[117],{"type":50,"value":83},{"type":50,"value":119},", the ",{"type":40,"tag":53,"props":121,"children":124},{"href":122,"rel":123},"https://www.docker.com/products/docker-desktop/",[57],[125],{"type":50,"value":126},"Docker Desktop",{"type":50,"value":128}," tool, and the ",{"type":40,"tag":130,"props":131,"children":133},"code",{"className":132},[],[134],{"type":50,"value":34},{"type":50,"value":136}," command ",{"type":40,"tag":53,"props":138,"children":141},{"href":139,"rel":140},"https://www.docker.com/products/cli/",[57],[142],{"type":50,"value":143},"available in the terminal",{"type":50,"value":145},".",{"type":40,"tag":46,"props":147,"children":148},{},[149],{"type":40,"tag":150,"props":151,"children":154},"img",{"alt":152,"src":153},"Image","https://crm.tentyp.dev/wp-content/uploads/2025/03/57624318-9111-4915-900d-63ed0e6a6e01.png",[],{"type":40,"tag":46,"props":156,"children":157},{},[158,160,172,174,181],{"type":50,"value":159},"To connect to the account, ",{"type":40,"tag":161,"props":162,"children":163},"strong",{},[164,166],{"type":50,"value":165},"open the terminal and enter the ",{"type":40,"tag":130,"props":167,"children":169},{"className":168},[],[170],{"type":50,"value":171},"docker login",{"type":50,"value":173}," command. It will open the browser, and upon successful login, it will authorize the session in the terminal. This is needed to push an image to the hub. Check out ",{"type":40,"tag":53,"props":175,"children":178},{"href":176,"rel":177},"https://docs.docker.com/get-started/docker_cheatsheet.pdf",[57],[179],{"type":50,"value":180},"the official cheat sheet",{"type":50,"value":182}," for a help.",{"type":40,"tag":46,"props":184,"children":185},{},[186],{"type":40,"tag":150,"props":187,"children":189},{"alt":152,"src":188},"https://crm.tentyp.dev/wp-content/uploads/2025/03/0c16873e-fec6-472b-8cdd-dbbee890c5c0.png",[],{"type":40,"tag":91,"props":191,"children":192},{},[],{"type":40,"tag":95,"props":194,"children":196},{"id":195},"how-to-create-a-docker-image",[197],{"type":50,"value":198},"How to create a Docker image?",{"type":40,"tag":46,"props":200,"children":201},{},[202,215,217,223],{"type":40,"tag":161,"props":203,"children":204},{},[205,207,213],{"type":50,"value":206},"Create a new directory for files and add an empty ",{"type":40,"tag":130,"props":208,"children":210},{"className":209},[],[211],{"type":50,"value":212},"Dockerfile",{"type":50,"value":214}," there",{"type":50,"value":216},". This is the most important file, as it's where you configure the project's environment. I also recommend creating a ",{"type":40,"tag":130,"props":218,"children":220},{"className":219},[],[221],{"type":50,"value":222},"package.json",{"type":50,"value":224}," where you can define tasks, eliminating the need to keep the commands in your mind, and pushing the current state to the repository.",{"type":40,"tag":46,"props":226,"children":227},{},[228],{"type":40,"tag":150,"props":229,"children":231},{"alt":152,"src":230},"https://crm.tentyp.dev/wp-content/uploads/2025/03/8e0eafe9-b0c6-4a7c-81b6-59c1ff729b73.png",[],{"type":40,"tag":46,"props":233,"children":234},{},[235,246],{"type":40,"tag":161,"props":236,"children":237},{},[238,240,245],{"type":50,"value":239},"The next step is to define the environment in the ",{"type":40,"tag":130,"props":241,"children":243},{"className":242},[],[244],{"type":50,"value":212},{"type":50,"value":145},{"type":50,"value":247}," This will be somewhat similar to setting up a clean Linux system. It might seem like a task for a DevOps, but don't worry, you can handle it. My project is to run on PHP 8.2 and Node 22, and support Yarn and Composer.",{"type":40,"tag":46,"props":249,"children":250},{},[251,253,258,260,266,268,274],{"type":50,"value":252},"First, ",{"type":40,"tag":161,"props":254,"children":255},{},[256],{"type":50,"value":257},"choose the base image on which you will build your container",{"type":50,"value":259},". If you feel confident, you can define everything you need on your own - PHP, its modules, Node, etc. In such a way, you can start with a basic image like ",{"type":40,"tag":130,"props":261,"children":263},{"className":262},[],[264],{"type":50,"value":265},"ubuntu:latest",{"type":50,"value":267},". I chose the ",{"type":40,"tag":130,"props":269,"children":271},{"className":270},[],[272],{"type":50,"value":273},"php:8.2",{"type":50,"value":275}," image since it already includes most of the required modules, to which I will only add additional things.",{"type":40,"tag":277,"props":278,"children":282},"pre",{"className":279,"code":280,"filename":212,"language":281,"meta":7,"style":7},"language-txt shiki shiki-themes one-dark-pro","FROM php:8.2\n","txt",[283],{"type":40,"tag":130,"props":284,"children":285},{"__ignoreMap":7},[286],{"type":40,"tag":287,"props":288,"children":291},"span",{"class":289,"line":290},"line",1,[292],{"type":40,"tag":287,"props":293,"children":294},{},[295],{"type":50,"value":280},{"type":40,"tag":46,"props":297,"children":298},{},[299,301,306,308,315],{"type":50,"value":300},"Once you have selected the base image, ",{"type":40,"tag":161,"props":302,"children":303},{},[304],{"type":50,"value":305},"add additional puzzle pieces and install the missing modules",{"type":50,"value":307},". You can do this using the ",{"type":40,"tag":53,"props":309,"children":312},{"href":310,"rel":311},"https://nodejs.org/en/download",[57],[313],{"type":50,"value":314},"official instructions",{"type":50,"value":316},". It's like configuring a Linux machine as if you were doing it on your machine, so the official tools documentation will help.",{"type":40,"tag":277,"props":318,"children":320},{"className":279,"code":319,"filename":212,"language":281,"meta":7,"style":7},"FROM php:8.2\n\nRUN apt-get update \\\n&& apt-get install -y git zip\n\nRUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \\\n&& apt-get install -y nodejs\n\nRUN npm install --global yarn\n\nRUN curl -sS https://getcomposer.org/installer | php \\\n&& mv composer.phar /usr/local/bin/composer\n",[321],{"type":40,"tag":130,"props":322,"children":323},{"__ignoreMap":7},[324,331,340,349,358,366,375,384,392,401,409,418],{"type":40,"tag":287,"props":325,"children":326},{"class":289,"line":290},[327],{"type":40,"tag":287,"props":328,"children":329},{},[330],{"type":50,"value":280},{"type":40,"tag":287,"props":332,"children":334},{"class":289,"line":333},2,[335],{"type":40,"tag":287,"props":336,"children":337},{"emptyLinePlaceholder":35},[338],{"type":50,"value":339},"\n",{"type":40,"tag":287,"props":341,"children":343},{"class":289,"line":342},3,[344],{"type":40,"tag":287,"props":345,"children":346},{},[347],{"type":50,"value":348},"RUN apt-get update \\\n",{"type":40,"tag":287,"props":350,"children":352},{"class":289,"line":351},4,[353],{"type":40,"tag":287,"props":354,"children":355},{},[356],{"type":50,"value":357},"&& apt-get install -y git zip\n",{"type":40,"tag":287,"props":359,"children":361},{"class":289,"line":360},5,[362],{"type":40,"tag":287,"props":363,"children":364},{"emptyLinePlaceholder":35},[365],{"type":50,"value":339},{"type":40,"tag":287,"props":367,"children":369},{"class":289,"line":368},6,[370],{"type":40,"tag":287,"props":371,"children":372},{},[373],{"type":50,"value":374},"RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \\\n",{"type":40,"tag":287,"props":376,"children":378},{"class":289,"line":377},7,[379],{"type":40,"tag":287,"props":380,"children":381},{},[382],{"type":50,"value":383},"&& apt-get install -y nodejs\n",{"type":40,"tag":287,"props":385,"children":387},{"class":289,"line":386},8,[388],{"type":40,"tag":287,"props":389,"children":390},{"emptyLinePlaceholder":35},[391],{"type":50,"value":339},{"type":40,"tag":287,"props":393,"children":395},{"class":289,"line":394},9,[396],{"type":40,"tag":287,"props":397,"children":398},{},[399],{"type":50,"value":400},"RUN npm install --global yarn\n",{"type":40,"tag":287,"props":402,"children":404},{"class":289,"line":403},10,[405],{"type":40,"tag":287,"props":406,"children":407},{"emptyLinePlaceholder":35},[408],{"type":50,"value":339},{"type":40,"tag":287,"props":410,"children":412},{"class":289,"line":411},11,[413],{"type":40,"tag":287,"props":414,"children":415},{},[416],{"type":50,"value":417},"RUN curl -sS https://getcomposer.org/installer | php \\\n",{"type":40,"tag":287,"props":419,"children":421},{"class":289,"line":420},12,[422],{"type":40,"tag":287,"props":423,"children":424},{},[425],{"type":50,"value":426},"&& mv composer.phar /usr/local/bin/composer\n",{"type":40,"tag":91,"props":428,"children":429},{},[],{"type":40,"tag":46,"props":431,"children":432},{},[433],{"type":50,"value":434},"Hi Guys! I've been working on something I’m really proud of - a new eBook all about code linting and formatting in web development. It’s filled with practical tips to help you set up the project environment so your code stays clean, consistent, and free of annoying little errors.",{"type":40,"tag":46,"props":436,"children":437},{},[438],{"type":40,"tag":161,"props":439,"children":440},{},[441],{"type":50,"value":442},"The plan is to sell it for $15, but if you're on my newsletter, you’ll get almost 70% discount. Just drop your email below, and you’ll get it for just $5 when it’s ready 🙌",{"type":40,"tag":444,"props":445,"children":446},"newsletter",{},[],{"type":40,"tag":91,"props":448,"children":449},{},[],{"type":40,"tag":95,"props":451,"children":453},{"id":452},"how-to-publish-docker-image",[454],{"type":50,"value":455},"How to publish Docker image?",{"type":40,"tag":46,"props":457,"children":458},{},[459],{"type":50,"value":460},"The process of publishing an image in Docker Hub consists of two steps. First, an image must be built. Next, this image needs to be pushed to the hub. You can find explanations below 👇",{"type":40,"tag":462,"props":463,"children":465},"spacer",{"height":464},75,[],{"type":40,"tag":467,"props":468,"children":470},"h3",{"id":469},"how-to-build-a-docker-image",[471],{"type":50,"value":472},"How to build a Docker image?",{"type":40,"tag":46,"props":474,"children":475},{},[476,478,484],{"type":50,"value":477},"To build a Docker image, use the ",{"type":40,"tag":130,"props":479,"children":481},{"className":480},[],[482],{"type":50,"value":483},"docker build",{"type":50,"value":485}," command along with a few arguments.",{"type":40,"tag":277,"props":487,"children":491},{"className":488,"code":489,"language":490,"meta":7,"style":7},"language-bash shiki shiki-themes one-dark-pro","docker build . --tag pragmatedev/vitewp-docker-test:latest --platform linux/amd64\n","bash",[492],{"type":40,"tag":130,"props":493,"children":494},{"__ignoreMap":7},[495],{"type":40,"tag":287,"props":496,"children":497},{"class":289,"line":290},[498,503,509,514,520,525,530],{"type":40,"tag":287,"props":499,"children":501},{"style":500},"--shiki-default:#61AFEF",[502],{"type":50,"value":34},{"type":40,"tag":287,"props":504,"children":506},{"style":505},"--shiki-default:#98C379",[507],{"type":50,"value":508}," build",{"type":40,"tag":287,"props":510,"children":511},{"style":505},[512],{"type":50,"value":513}," .",{"type":40,"tag":287,"props":515,"children":517},{"style":516},"--shiki-default:#D19A66",[518],{"type":50,"value":519}," --tag",{"type":40,"tag":287,"props":521,"children":522},{"style":505},[523],{"type":50,"value":524}," pragmatedev/vitewp-docker-test:latest",{"type":40,"tag":287,"props":526,"children":527},{"style":516},[528],{"type":50,"value":529}," --platform",{"type":40,"tag":287,"props":531,"children":532},{"style":505},[533],{"type":50,"value":534}," linux/amd64\n",{"type":40,"tag":536,"props":537,"children":538},"ol",{},[539,551,562],{"type":40,"tag":540,"props":541,"children":542},"li",{},[543,549],{"type":40,"tag":130,"props":544,"children":546},{"className":545},[],[547],{"type":50,"value":548},"docker build .",{"type":50,"value":550}," Builds a Docker image from the Dockerfile in the current directory.",{"type":40,"tag":540,"props":552,"children":553},{},[554,560],{"type":40,"tag":130,"props":555,"children":557},{"className":556},[],[558],{"type":50,"value":559},"--tag pragmatedev/vitewp-docker-test:latest",{"type":50,"value":561}," Gives the image a name and tag.",{"type":40,"tag":540,"props":563,"children":564},{},[565,571],{"type":40,"tag":130,"props":566,"children":568},{"className":567},[],[569],{"type":50,"value":570},"--platform linux/amd64",{"type":50,"value":572}," Specifies the platform for which the image should be built. This is useful when you are working on a machine with a different architecture, such as macOS, and want to force compatibility with the server.",{"type":40,"tag":462,"props":574,"children":575},{"height":464},[],{"type":40,"tag":467,"props":577,"children":579},{"id":578},"how-to-push-a-docker-image",[580],{"type":50,"value":581},"How to push a Docker image?",{"type":40,"tag":46,"props":583,"children":584},{},[585,587,593],{"type":50,"value":586},"To publish a Docker image, use the ",{"type":40,"tag":130,"props":588,"children":590},{"className":589},[],[591],{"type":50,"value":592},"docker push",{"type":50,"value":485},{"type":40,"tag":277,"props":595,"children":597},{"className":488,"code":596,"language":490,"meta":7,"style":7},"docker push pragmatedev/vitewp-docker-test:latest\n",[598],{"type":40,"tag":130,"props":599,"children":600},{"__ignoreMap":7},[601],{"type":40,"tag":287,"props":602,"children":603},{"class":289,"line":290},[604,608,613],{"type":40,"tag":287,"props":605,"children":606},{"style":500},[607],{"type":50,"value":34},{"type":40,"tag":287,"props":609,"children":610},{"style":505},[611],{"type":50,"value":612}," push",{"type":40,"tag":287,"props":614,"children":615},{"style":505},[616],{"type":50,"value":617}," pragmatedev/vitewp-docker-test:latest\n",{"type":40,"tag":536,"props":619,"children":620},{},[621,631],{"type":40,"tag":540,"props":622,"children":623},{},[624,629],{"type":40,"tag":130,"props":625,"children":627},{"className":626},[],[628],{"type":50,"value":592},{"type":50,"value":630}," Publishes a Docker image to Docker Hub.",{"type":40,"tag":540,"props":632,"children":633},{},[634,640],{"type":40,"tag":130,"props":635,"children":637},{"className":636},[],[638],{"type":50,"value":639},"pragmatedev/vitewp-docker-test:latest",{"type":50,"value":641}," Defines name and tag for the image.",{"type":40,"tag":462,"props":643,"children":644},{"height":464},[],{"type":40,"tag":467,"props":646,"children":648},{"id":647},"how-to-find-a-docker-image",[649],{"type":50,"value":650},"How to find a Docker image?",{"type":40,"tag":46,"props":652,"children":653},{},[654,656,662],{"type":50,"value":655},"After firing the commands, your image should be pushed to Docker Hub and visible there. You can verify it by visiting the following URL: ",{"type":40,"tag":130,"props":657,"children":659},{"className":658},[],[660],{"type":50,"value":661},"https://hub.docker.com/r/{image_name}",{"type":50,"value":145},{"type":40,"tag":46,"props":664,"children":665},{},[666],{"type":40,"tag":150,"props":667,"children":669},{"alt":152,"src":668},"https://crm.tentyp.dev/wp-content/uploads/2025/03/9012200f-75f5-4171-8fd7-1167d591442a.png",[],{"type":40,"tag":462,"props":671,"children":672},{"height":464},[],{"type":40,"tag":467,"props":674,"children":676},{"id":675},"how-to-simplify-a-process",[677],{"type":50,"value":678},"How to simplify a process?",{"type":40,"tag":46,"props":680,"children":681},{},[682,684,689,691,697,698,704],{"type":50,"value":683},"To simplify the process and minimize what you need to remember, define tasks in your project's ",{"type":40,"tag":130,"props":685,"children":687},{"className":686},[],[688],{"type":50,"value":222},{"type":50,"value":690},". This allows you to use simple ",{"type":40,"tag":130,"props":692,"children":694},{"className":693},[],[695],{"type":50,"value":696},"yarn build",{"type":50,"value":62},{"type":40,"tag":130,"props":699,"children":701},{"className":700},[],[702],{"type":50,"value":703},"yarn push",{"type":50,"value":705}," commands.",{"type":40,"tag":277,"props":707,"children":711},{"className":708,"code":709,"filename":222,"language":710,"meta":7,"style":7},"language-json shiki shiki-themes one-dark-pro","{\n    \"scripts\": {\n        \"build\": \"docker build . --tag pragmatedev/vitewp-docker-test:latest --platform linux/amd64\",\n        \"push\": \"docker push pragmatedev/vitewp-docker-test:latest\",\n    }\n}\n","json",[712],{"type":40,"tag":130,"props":713,"children":714},{"__ignoreMap":7},[715,724,738,761,782,790],{"type":40,"tag":287,"props":716,"children":717},{"class":289,"line":290},[718],{"type":40,"tag":287,"props":719,"children":721},{"style":720},"--shiki-default:#ABB2BF",[722],{"type":50,"value":723},"{\n",{"type":40,"tag":287,"props":725,"children":726},{"class":289,"line":333},[727,733],{"type":40,"tag":287,"props":728,"children":730},{"style":729},"--shiki-default:#E06C75",[731],{"type":50,"value":732},"    \"scripts\"",{"type":40,"tag":287,"props":734,"children":735},{"style":720},[736],{"type":50,"value":737},": {\n",{"type":40,"tag":287,"props":739,"children":740},{"class":289,"line":342},[741,746,751,756],{"type":40,"tag":287,"props":742,"children":743},{"style":729},[744],{"type":50,"value":745},"        \"build\"",{"type":40,"tag":287,"props":747,"children":748},{"style":720},[749],{"type":50,"value":750},": ",{"type":40,"tag":287,"props":752,"children":753},{"style":505},[754],{"type":50,"value":755},"\"docker build . --tag pragmatedev/vitewp-docker-test:latest --platform linux/amd64\"",{"type":40,"tag":287,"props":757,"children":758},{"style":720},[759],{"type":50,"value":760},",\n",{"type":40,"tag":287,"props":762,"children":763},{"class":289,"line":351},[764,769,773,778],{"type":40,"tag":287,"props":765,"children":766},{"style":729},[767],{"type":50,"value":768},"        \"push\"",{"type":40,"tag":287,"props":770,"children":771},{"style":720},[772],{"type":50,"value":750},{"type":40,"tag":287,"props":774,"children":775},{"style":505},[776],{"type":50,"value":777},"\"docker push pragmatedev/vitewp-docker-test:latest\"",{"type":40,"tag":287,"props":779,"children":780},{"style":720},[781],{"type":50,"value":760},{"type":40,"tag":287,"props":783,"children":784},{"class":289,"line":360},[785],{"type":40,"tag":287,"props":786,"children":787},{"style":720},[788],{"type":50,"value":789},"    }\n",{"type":40,"tag":287,"props":791,"children":792},{"class":289,"line":368},[793],{"type":40,"tag":287,"props":794,"children":795},{"style":720},[796],{"type":50,"value":797},"}\n",{"type":40,"tag":91,"props":799,"children":800},{},[],{"type":40,"tag":95,"props":802,"children":804},{"id":803},"how-to-use-docker-hub-images-in-bitbucket-pipelines",[805],{"type":50,"value":806},"How to use Docker Hub images in Bitbucket Pipelines?",{"type":40,"tag":46,"props":808,"children":809},{},[810,812,818,820,826],{"type":50,"value":811},"To use the image in your project, open the ",{"type":40,"tag":130,"props":813,"children":815},{"className":814},[],[816],{"type":50,"value":817},"bitbucket-pipelines.yml",{"type":50,"value":819}," file and specify its name in the ",{"type":40,"tag":130,"props":821,"children":823},{"className":822},[],[824],{"type":50,"value":825},"image",{"type":50,"value":827}," key. After committing your changes and triggering the action, it should work fine.",{"type":40,"tag":277,"props":829,"children":834},{"className":830,"code":831,"filename":817,"highlights":832,"language":833,"meta":7,"style":7},"language-yaml shiki shiki-themes one-dark-pro","definitions:\n  steps:\n    - step: &lint\n        name: Lint\n        image: pragmatedev/vitewp-docker-test\n        script:\n          - cd wp-content/themes/footmate\n          - composer install\n          - yarn install\n          - yarn lint\n        caches:\n          - composer\n          - node\n  caches:\n    composer: wp-content/themes/footmate/vendor\n    node: wp-content/themes/footmate/node_modules\n\npipelines:\n  custom:\n    lint:\n      - step: *lint\n  pull-requests:\n    '**':\n      - step: *lint\n",[360],"yaml",[835],{"type":40,"tag":130,"props":836,"children":837},{"__ignoreMap":7},[838,851,863,892,909,928,940,953,965,977,989,1001,1013,1026,1039,1057,1075,1083,1096,1109,1122,1148,1161,1174],{"type":40,"tag":287,"props":839,"children":840},{"class":289,"line":290},[841,846],{"type":40,"tag":287,"props":842,"children":843},{"style":729},[844],{"type":50,"value":845},"definitions",{"type":40,"tag":287,"props":847,"children":848},{"style":720},[849],{"type":50,"value":850},":\n",{"type":40,"tag":287,"props":852,"children":853},{"class":289,"line":333},[854,859],{"type":40,"tag":287,"props":855,"children":856},{"style":729},[857],{"type":50,"value":858},"  steps",{"type":40,"tag":287,"props":860,"children":861},{"style":720},[862],{"type":50,"value":850},{"type":40,"tag":287,"props":864,"children":865},{"class":289,"line":342},[866,871,876,880,886],{"type":40,"tag":287,"props":867,"children":868},{"style":720},[869],{"type":50,"value":870},"    - ",{"type":40,"tag":287,"props":872,"children":873},{"style":729},[874],{"type":50,"value":875},"step",{"type":40,"tag":287,"props":877,"children":878},{"style":720},[879],{"type":50,"value":750},{"type":40,"tag":287,"props":881,"children":883},{"style":882},"--shiki-default:#C678DD",[884],{"type":50,"value":885},"&",{"type":40,"tag":287,"props":887,"children":889},{"style":888},"--shiki-default:#E5C07B",[890],{"type":50,"value":891},"lint\n",{"type":40,"tag":287,"props":893,"children":894},{"class":289,"line":351},[895,900,904],{"type":40,"tag":287,"props":896,"children":897},{"style":729},[898],{"type":50,"value":899},"        name",{"type":40,"tag":287,"props":901,"children":902},{"style":720},[903],{"type":50,"value":750},{"type":40,"tag":287,"props":905,"children":906},{"style":505},[907],{"type":50,"value":908},"Lint\n",{"type":40,"tag":287,"props":910,"children":913},{"class":911,"line":360},[289,912],"highlight",[914,919,923],{"type":40,"tag":287,"props":915,"children":916},{"style":729},[917],{"type":50,"value":918},"        image",{"type":40,"tag":287,"props":920,"children":921},{"style":720},[922],{"type":50,"value":750},{"type":40,"tag":287,"props":924,"children":925},{"style":505},[926],{"type":50,"value":927},"pragmatedev/vitewp-docker-test\n",{"type":40,"tag":287,"props":929,"children":930},{"class":289,"line":368},[931,936],{"type":40,"tag":287,"props":932,"children":933},{"style":729},[934],{"type":50,"value":935},"        script",{"type":40,"tag":287,"props":937,"children":938},{"style":720},[939],{"type":50,"value":850},{"type":40,"tag":287,"props":941,"children":942},{"class":289,"line":377},[943,948],{"type":40,"tag":287,"props":944,"children":945},{"style":720},[946],{"type":50,"value":947},"          - ",{"type":40,"tag":287,"props":949,"children":950},{"style":505},[951],{"type":50,"value":952},"cd wp-content/themes/footmate\n",{"type":40,"tag":287,"props":954,"children":955},{"class":289,"line":386},[956,960],{"type":40,"tag":287,"props":957,"children":958},{"style":720},[959],{"type":50,"value":947},{"type":40,"tag":287,"props":961,"children":962},{"style":505},[963],{"type":50,"value":964},"composer install\n",{"type":40,"tag":287,"props":966,"children":967},{"class":289,"line":394},[968,972],{"type":40,"tag":287,"props":969,"children":970},{"style":720},[971],{"type":50,"value":947},{"type":40,"tag":287,"props":973,"children":974},{"style":505},[975],{"type":50,"value":976},"yarn install\n",{"type":40,"tag":287,"props":978,"children":979},{"class":289,"line":403},[980,984],{"type":40,"tag":287,"props":981,"children":982},{"style":720},[983],{"type":50,"value":947},{"type":40,"tag":287,"props":985,"children":986},{"style":505},[987],{"type":50,"value":988},"yarn lint\n",{"type":40,"tag":287,"props":990,"children":991},{"class":289,"line":411},[992,997],{"type":40,"tag":287,"props":993,"children":994},{"style":729},[995],{"type":50,"value":996},"        caches",{"type":40,"tag":287,"props":998,"children":999},{"style":720},[1000],{"type":50,"value":850},{"type":40,"tag":287,"props":1002,"children":1003},{"class":289,"line":420},[1004,1008],{"type":40,"tag":287,"props":1005,"children":1006},{"style":720},[1007],{"type":50,"value":947},{"type":40,"tag":287,"props":1009,"children":1010},{"style":505},[1011],{"type":50,"value":1012},"composer\n",{"type":40,"tag":287,"props":1014,"children":1016},{"class":289,"line":1015},13,[1017,1021],{"type":40,"tag":287,"props":1018,"children":1019},{"style":720},[1020],{"type":50,"value":947},{"type":40,"tag":287,"props":1022,"children":1023},{"style":505},[1024],{"type":50,"value":1025},"node\n",{"type":40,"tag":287,"props":1027,"children":1029},{"class":289,"line":1028},14,[1030,1035],{"type":40,"tag":287,"props":1031,"children":1032},{"style":729},[1033],{"type":50,"value":1034},"  caches",{"type":40,"tag":287,"props":1036,"children":1037},{"style":720},[1038],{"type":50,"value":850},{"type":40,"tag":287,"props":1040,"children":1042},{"class":289,"line":1041},15,[1043,1048,1052],{"type":40,"tag":287,"props":1044,"children":1045},{"style":729},[1046],{"type":50,"value":1047},"    composer",{"type":40,"tag":287,"props":1049,"children":1050},{"style":720},[1051],{"type":50,"value":750},{"type":40,"tag":287,"props":1053,"children":1054},{"style":505},[1055],{"type":50,"value":1056},"wp-content/themes/footmate/vendor\n",{"type":40,"tag":287,"props":1058,"children":1060},{"class":289,"line":1059},16,[1061,1066,1070],{"type":40,"tag":287,"props":1062,"children":1063},{"style":729},[1064],{"type":50,"value":1065},"    node",{"type":40,"tag":287,"props":1067,"children":1068},{"style":720},[1069],{"type":50,"value":750},{"type":40,"tag":287,"props":1071,"children":1072},{"style":505},[1073],{"type":50,"value":1074},"wp-content/themes/footmate/node_modules\n",{"type":40,"tag":287,"props":1076,"children":1078},{"class":289,"line":1077},17,[1079],{"type":40,"tag":287,"props":1080,"children":1081},{"emptyLinePlaceholder":35},[1082],{"type":50,"value":339},{"type":40,"tag":287,"props":1084,"children":1086},{"class":289,"line":1085},18,[1087,1092],{"type":40,"tag":287,"props":1088,"children":1089},{"style":729},[1090],{"type":50,"value":1091},"pipelines",{"type":40,"tag":287,"props":1093,"children":1094},{"style":720},[1095],{"type":50,"value":850},{"type":40,"tag":287,"props":1097,"children":1099},{"class":289,"line":1098},19,[1100,1105],{"type":40,"tag":287,"props":1101,"children":1102},{"style":729},[1103],{"type":50,"value":1104},"  custom",{"type":40,"tag":287,"props":1106,"children":1107},{"style":720},[1108],{"type":50,"value":850},{"type":40,"tag":287,"props":1110,"children":1112},{"class":289,"line":1111},20,[1113,1118],{"type":40,"tag":287,"props":1114,"children":1115},{"style":729},[1116],{"type":50,"value":1117},"    lint",{"type":40,"tag":287,"props":1119,"children":1120},{"style":720},[1121],{"type":50,"value":850},{"type":40,"tag":287,"props":1123,"children":1125},{"class":289,"line":1124},21,[1126,1131,1135,1139,1144],{"type":40,"tag":287,"props":1127,"children":1128},{"style":720},[1129],{"type":50,"value":1130},"      - ",{"type":40,"tag":287,"props":1132,"children":1133},{"style":729},[1134],{"type":50,"value":875},{"type":40,"tag":287,"props":1136,"children":1137},{"style":720},[1138],{"type":50,"value":750},{"type":40,"tag":287,"props":1140,"children":1141},{"style":882},[1142],{"type":50,"value":1143},"*",{"type":40,"tag":287,"props":1145,"children":1146},{"style":729},[1147],{"type":50,"value":891},{"type":40,"tag":287,"props":1149,"children":1151},{"class":289,"line":1150},22,[1152,1157],{"type":40,"tag":287,"props":1153,"children":1154},{"style":729},[1155],{"type":50,"value":1156},"  pull-requests",{"type":40,"tag":287,"props":1158,"children":1159},{"style":720},[1160],{"type":50,"value":850},{"type":40,"tag":287,"props":1162,"children":1164},{"class":289,"line":1163},23,[1165,1170],{"type":40,"tag":287,"props":1166,"children":1167},{"style":505},[1168],{"type":50,"value":1169},"    '**'",{"type":40,"tag":287,"props":1171,"children":1172},{"style":720},[1173],{"type":50,"value":850},{"type":40,"tag":287,"props":1175,"children":1177},{"class":289,"line":1176},24,[1178,1182,1186,1190,1194],{"type":40,"tag":287,"props":1179,"children":1180},{"style":720},[1181],{"type":50,"value":1130},{"type":40,"tag":287,"props":1183,"children":1184},{"style":729},[1185],{"type":50,"value":875},{"type":40,"tag":287,"props":1187,"children":1188},{"style":720},[1189],{"type":50,"value":750},{"type":40,"tag":287,"props":1191,"children":1192},{"style":882},[1193],{"type":50,"value":1143},{"type":40,"tag":287,"props":1195,"children":1196},{"style":729},[1197],{"type":50,"value":891},{"type":40,"tag":46,"props":1199,"children":1200},{},[1201],{"type":50,"value":1202},"The keyword is \"should.\" In my case, the first attempt did not succeed, but through simple trial and error, I was able to resolve it. I'm aware that your project will have unique elements that cannot be foreseen, so experimentation might be required.",{"type":40,"tag":46,"props":1204,"children":1205},{},[1206],{"type":40,"tag":150,"props":1207,"children":1209},{"alt":152,"src":1208},"https://crm.tentyp.dev/wp-content/uploads/2025/03/83115091-1bdc-47a3-b871-3c768f8378cd.png",[],{"type":40,"tag":46,"props":1211,"children":1212},{},[1213],{"type":50,"value":1214},"I had to implement several additional modifications in the Dockerfile to ensure compatibility in both Bitbucket Pipelines and GitHub Actions. The majority concerned configurations for additional tools. Below is an example of a working image configuration for my project.",{"type":40,"tag":277,"props":1216,"children":1218},{"className":279,"code":1217,"filename":212,"language":281,"meta":7,"style":7},"FROM php:8.2\n\nRUN apt-get update \\\n&& apt-get install -y git zip\n\nRUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \\\n&& apt-get install -y nodejs\n\nRUN npm install --global yarn\n\nRUN curl -sS https://getcomposer.org/installer | php \\\n&& mv composer.phar /usr/local/bin/composer\n\nRUN git config --system --add safe.directory '*'\n\nENV COMPOSER_ALLOW_SUPERUSER=1\n",[1219],{"type":40,"tag":130,"props":1220,"children":1221},{"__ignoreMap":7},[1222,1229,1236,1243,1250,1257,1264,1271,1278,1285,1292,1299,1306,1313,1321,1328],{"type":40,"tag":287,"props":1223,"children":1224},{"class":289,"line":290},[1225],{"type":40,"tag":287,"props":1226,"children":1227},{},[1228],{"type":50,"value":280},{"type":40,"tag":287,"props":1230,"children":1231},{"class":289,"line":333},[1232],{"type":40,"tag":287,"props":1233,"children":1234},{"emptyLinePlaceholder":35},[1235],{"type":50,"value":339},{"type":40,"tag":287,"props":1237,"children":1238},{"class":289,"line":342},[1239],{"type":40,"tag":287,"props":1240,"children":1241},{},[1242],{"type":50,"value":348},{"type":40,"tag":287,"props":1244,"children":1245},{"class":289,"line":351},[1246],{"type":40,"tag":287,"props":1247,"children":1248},{},[1249],{"type":50,"value":357},{"type":40,"tag":287,"props":1251,"children":1252},{"class":289,"line":360},[1253],{"type":40,"tag":287,"props":1254,"children":1255},{"emptyLinePlaceholder":35},[1256],{"type":50,"value":339},{"type":40,"tag":287,"props":1258,"children":1259},{"class":289,"line":368},[1260],{"type":40,"tag":287,"props":1261,"children":1262},{},[1263],{"type":50,"value":374},{"type":40,"tag":287,"props":1265,"children":1266},{"class":289,"line":377},[1267],{"type":40,"tag":287,"props":1268,"children":1269},{},[1270],{"type":50,"value":383},{"type":40,"tag":287,"props":1272,"children":1273},{"class":289,"line":386},[1274],{"type":40,"tag":287,"props":1275,"children":1276},{"emptyLinePlaceholder":35},[1277],{"type":50,"value":339},{"type":40,"tag":287,"props":1279,"children":1280},{"class":289,"line":394},[1281],{"type":40,"tag":287,"props":1282,"children":1283},{},[1284],{"type":50,"value":400},{"type":40,"tag":287,"props":1286,"children":1287},{"class":289,"line":403},[1288],{"type":40,"tag":287,"props":1289,"children":1290},{"emptyLinePlaceholder":35},[1291],{"type":50,"value":339},{"type":40,"tag":287,"props":1293,"children":1294},{"class":289,"line":411},[1295],{"type":40,"tag":287,"props":1296,"children":1297},{},[1298],{"type":50,"value":417},{"type":40,"tag":287,"props":1300,"children":1301},{"class":289,"line":420},[1302],{"type":40,"tag":287,"props":1303,"children":1304},{},[1305],{"type":50,"value":426},{"type":40,"tag":287,"props":1307,"children":1308},{"class":289,"line":1015},[1309],{"type":40,"tag":287,"props":1310,"children":1311},{"emptyLinePlaceholder":35},[1312],{"type":50,"value":339},{"type":40,"tag":287,"props":1314,"children":1315},{"class":289,"line":1028},[1316],{"type":40,"tag":287,"props":1317,"children":1318},{},[1319],{"type":50,"value":1320},"RUN git config --system --add safe.directory '*'\n",{"type":40,"tag":287,"props":1322,"children":1323},{"class":289,"line":1041},[1324],{"type":40,"tag":287,"props":1325,"children":1326},{"emptyLinePlaceholder":35},[1327],{"type":50,"value":339},{"type":40,"tag":287,"props":1329,"children":1330},{"class":289,"line":1059},[1331],{"type":40,"tag":287,"props":1332,"children":1333},{},[1334],{"type":50,"value":1335},"ENV COMPOSER_ALLOW_SUPERUSER=1\n",{"type":40,"tag":91,"props":1337,"children":1338},{},[],{"type":40,"tag":46,"props":1340,"children":1341},{},[1342,1344,1351,1353,1360],{"type":50,"value":1343},"Thank you so much for joining me in today ❤️ Your support means a lot to me, and it keeps me motivated to create more content. If you enjoyed this video, please consider ",{"type":40,"tag":53,"props":1345,"children":1348},{"href":1346,"rel":1347},"https://www.youtube.com/@pragmatedev?sub_confirmation=1",[57],[1349],{"type":50,"value":1350},"subscribing to the channel",{"type":50,"value":1352}," and giving it a thumbs-up - it really helps spread the word. And if you need developers who truly care about quality and delivering great results, visit my company’s site: ",{"type":40,"tag":53,"props":1354,"children":1357},{"href":1355,"rel":1356},"https://coditive.com/?utm_source=www&utm_medium=content&utm_campaign=pragmate_dev",[57],[1358],{"type":50,"value":1359},"coditive.com",{"type":50,"value":1361}," or contact me with the form below. Thanks again and see you next time!",{"type":40,"tag":1363,"props":1364,"children":1365},"style",{},[1366],{"type":50,"value":1367},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":333,"depth":333,"links":1369},[1370,1371,1372,1378],{"id":97,"depth":333,"text":100},{"id":195,"depth":333,"text":198},{"id":452,"depth":333,"text":455,"children":1373},[1374,1375,1376,1377],{"id":469,"depth":342,"text":472},{"id":578,"depth":342,"text":581},{"id":647,"depth":342,"text":650},{"id":675,"depth":342,"text":678},{"id":803,"depth":333,"text":806},"markdown","content:environment:how-to-create-docker-image-on-docker-hub.md","content","environment/how-to-create-docker-image-on-docker-hub.md","environment/how-to-create-docker-image-on-docker-hub","md",1784897567729]