Urgent.News

What's breaking now, across thousands of outlets.

Tech

Dockerfile CMD Explained: Build-Time vs Runtime and How CMD Override Works

Dockerfile শেখার সময় FROM , RUN , WORKDIR , এবং COPY নিয়ে কাজ করার পর খুব স্বাভাবিকভাবেই একটি প্রশ্ন আসে: Container start হলে application automatically কীভাবে run করবে? আমরা যদি শুধু এই ধরনের Dockerfile লিখি— FROM ubuntu:24.04 RUN apt update RUN apt install -y golang WORKDIR /app COPY ./server.go ./server.go তাহলে image তৈরি হবে ঠিকই। Go-ও install হবে। server.go -ও image-এর মধ্যে চলে যাবে। কিন্তু…

Dockerfile CMD instruction is crucial in determining the default runtime command for a container. When you build an image using Dockerfile, the CMD instruction is not executed during the build process. Instead, it serves as a default command for the container when it is started. In the given example, the CMD command is [ go, run, server.go ], which means that when the container is launched using `docker run`, the Go server will automatically start running on port 8080.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Availability slots across timezones and DST

TL;DR: 09:00 is wall-clock time in a timezone, not a UTC instant. Resolve the offset in the business's zone and convert to UTC last, or you're an hour off across zones and grow a phantom slot on the…

  • Availability slots must be built in business's timezone to avoid DST issues.
  • Convert to UTC only after resolving offset in business's timezone.
  • Store slots as UTC instants and compare using half-open interval overlap.

More from Sunday 30 August →