<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Abdulmuhaimin1219</title>
    <description>The latest articles on Forem by Abdulmuhaimin1219 (@abdulmuhaimin1219).</description>
    <link>https://forem.com/abdulmuhaimin1219</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2029868%2F021d3308-db63-42d9-a175-bc1cad27eae1.png</url>
      <title>Forem: Abdulmuhaimin1219</title>
      <link>https://forem.com/abdulmuhaimin1219</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/abdulmuhaimin1219"/>
    <language>en</language>
    <item>
      <title>Common Docker Mistakes That Slow Your CI/CD (And How to Fix Them)</title>
      <dc:creator>Abdulmuhaimin1219</dc:creator>
      <pubDate>Mon, 02 Feb 2026 17:54:13 +0000</pubDate>
      <link>https://forem.com/abdulmuhaimin1219/common-docker-mistakes-that-slow-your-cicd-and-how-to-fix-them-50m4</link>
      <guid>https://forem.com/abdulmuhaimin1219/common-docker-mistakes-that-slow-your-cicd-and-how-to-fix-them-50m4</guid>
      <description>&lt;h2&gt;
  
  
  10 Docker Anti-Patterns (And How to Fix Them)
&lt;/h2&gt;

&lt;p&gt;I have audited many Dockerfiles across DevOps teams and startups. Despite differences in team size, maturity, and industry, the same architectural mistakes appear repeatedly.&lt;/p&gt;

&lt;p&gt;These issues are rarely the result of negligence or lack of skill. Docker is easy to adopt but difficult to use correctly at scale. A Dockerfile copied from a tutorial may build successfully and pass initial tests, which makes it tempting to move on without revisiting it. Months later, teams are left diagnosing 15+ minute CI builds, multi-gigabyte images, and vulnerability scanners reporting critical findings.&lt;/p&gt;

&lt;p&gt;This article outlines ten Docker anti-patterns that commonly appear in production environments and provides concrete, low-effort changes to correct them.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Non-Deterministic Base Images
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The Anti-Pattern:&lt;/strong&gt; Using the &lt;code&gt;latest&lt;/code&gt; tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; node:latest &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Using &lt;code&gt;latest&lt;/code&gt; as a base image&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using &lt;code&gt;latest&lt;/code&gt; creates a moving target. A build that works on Friday may fail on Saturday if the upstream image changes, breaking native dependencies or introducing incompatible updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Pin exact versions (runtime + OS variant) for reproducible builds. This ensures identical images every time. For maximum immutability, use digest pinning &lt;code&gt;@sha256:…&lt;/code&gt; in CI/CD. In 2026, prefer Debian-based &lt;code&gt;slim&lt;/code&gt; images for broad compatibility.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM node:20.11.1-bookworm-slim@sha256:&amp;lt;digest&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Bloated Base Images
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anti-pattern:&lt;/strong&gt; Treating containers like mini VMs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM ubuntu:24.04
RUN apt-get update &amp;amp;&amp;amp; apt-get install -y nodejs npm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works, which is why it survives code review.&lt;/p&gt;

&lt;p&gt;But full OS images quietly tax everything downstream: larger pulls, slower CI, noisier vulnerability scans, and patch cycles tied to an entire distribution instead of your runtime. None of this hurts locally. It only shows up once you operate at scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix:&lt;/strong&gt; Start from the minimum executable surface, not &lt;strong&gt;a familiar OS&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Your base image should exist for one reason only: to run the compiled artifact or runtime process. Anything beyond that is technical debt with interest.&lt;/p&gt;

&lt;p&gt;For Node.js in 2026, the practical hierarchy looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM node:20.17.0-bookworm-slim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Debian bookworm-slim remains the default choice for production&lt;/li&gt;
&lt;li&gt;glibc avoids native module surprises&lt;/li&gt;
&lt;li&gt;small enough to be efficient, large enough to be boring (boring is good)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM node:20.17.0-alpine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Viable when image size is critical&lt;/li&gt;
&lt;li&gt;musl libc will surface edge cases in native dependencies&lt;/li&gt;
&lt;li&gt;requires explicit testing discipline, not hope
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM cgr.dev/chainguard/node:20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;No shell, no package manager, no OS noise&lt;/li&gt;
&lt;li&gt;Forces runtime immutability by design&lt;/li&gt;
&lt;li&gt;Ideal for hardened production tiers and regulated environments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Switching off full OS images typically cuts image size 80–95%, reduces CVE noise dramatically, and shortens CI pipelines without changing application code.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Inefficient Build Caching
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anti-pattern:&lt;/strong&gt; Busting the dependency cache on every commit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM node:20.17.0-bookworm-slim
WORKDIR /app
COPY . .
RUN npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This invalidates the most expensive layer in your build every time any source file changes. CI still “works”, but build times quietly degrade as the repo grows.&lt;/p&gt;

&lt;p&gt;At scale, this shows up as slow pipelines, wasted compute, and developers normalising 10–15 minute builds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Order layers by change frequency. Let Docker cache do its job.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM node:20.17.0-bookworm-slim
WORKDIR /app

COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm \
    npm ci --omit=dev

COPY . .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Dependency manifests change rarely → cached long-term&lt;/li&gt;
&lt;li&gt;Application code changes frequently → cheap rebuilds&lt;/li&gt;
&lt;li&gt;BuildKit cache mounts persist npm artifacts across builds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This pattern turns dependency installs from a recurring cost into a near one-time operation.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Violation of Least Privilege (Root User)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anti-pattern:&lt;/strong&gt; Accepting the default user.&lt;/p&gt;

&lt;p&gt;By default, containers run as root. If a process is compromised and escapes the container, it escapes as root. That’s not theoretical; that’s how real incidents cascade.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Drop privileges explicitly.&lt;/p&gt;

&lt;p&gt;Most modern runtime images already ship with an unprivileged user. Use it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM node:20.17.0-bookworm-slim
WORKDIR /app

RUN chown -R node:node /app
USER node

COPY --chown=node:node . .
CMD ["node", "server.js"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is baseline defense-in-depth for production, not an “advanced hardening” step.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Hardcoded Secrets
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anti-pattern:&lt;/strong&gt; Baking credentials into images.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ENV AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Secrets embedded in images persist forever in layers, registries, caches, and backups. Rotating them doesn’t remove them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Inject secrets at runtime or mount them ephemerally at build time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Build-time secret (e.g., private npm registry)
RUN --mount=type=secret,id=npmrc,target=/root/.npmrc \
    npm ci --omit=dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Runtime injection (Docker/Kubernetes secrets, env vars) is safest.&lt;br&gt;
If a secret ever appears in docker history, it’s already leaked.&lt;/p&gt;
&lt;h3&gt;
  
  
  6. Leaking the Build Context
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anti-pattern:&lt;/strong&gt; Shipping your entire repo to the Docker daemon.&lt;/p&gt;

&lt;p&gt;No .dockerignore means .git, node modules, test artifacts, and editor configs are sent on every build. This bloats context uploads, invalidates caches, and slows CI for no functional reason.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Be aggressively explicit about what doesn’t belong in the image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.git
node_modules
.env
coverage
.vscode
dist
build
Dockerfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On large repositories, this alone can shave minutes off CI builds.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Lack of Observability (Health Checks)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anti-pattern:&lt;/strong&gt; Assuming “running = healthy.”&lt;/p&gt;

&lt;p&gt;A process can be alive but deadlocked, DB-disconnected, or otherwise non-functional. Without health indicators, orchestrators keep sending traffic to zombies. CI/CD and production monitoring silently degrade.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Define explicit health checks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
  CMD curl -f http://localhost:3000/health || exit 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Kubernetes, mirror this with liveness and readiness probes.&lt;br&gt;
Orchestrators then restart stuck containers or reroute traffic automatically, with no human intervention needed.&lt;/p&gt;
&lt;h3&gt;
  
  
  8. Monolithic Dockerfiles
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anti-pattern:&lt;/strong&gt; One Dockerfile for everything.&lt;/p&gt;

&lt;p&gt;Dev tools like &lt;code&gt;git&lt;/code&gt; and &lt;code&gt;curl&lt;/code&gt;in production? Yep. Bloated images, unnecessary attack surface, slower deployments. This “convenience-first” approach rarely pays off beyond local testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Multi-stage builds. Keep only what’s needed at runtime.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# syntax=docker/dockerfile:1

FROM node:20.17.0-bookworm-slim AS builder
WORKDIR /app
COPY package*.json ./
RUN --mount=type=cache,target=/root/.npm \
    npm ci
COPY . .
RUN npm run build

FROM node:20.17.0-bookworm-slim
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
USER node
CMD ["node", "dist/index.js"]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final image contains only runtime artifacts.&lt;br&gt;
Smaller. Safer. Predictable. No surprises in prod.&lt;/p&gt;
&lt;h3&gt;
  
  
  9. Inefficient Layering
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anti-pattern:&lt;/strong&gt; Multiple RUNs without cleanup.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RUN apt-get update
RUN apt-get install -y curl
RUN apt-get clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deleting files in one layer doesn’t shrink previous layers image size still balloons. At scale, this is silent infrastructure debt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Chain commands and clean in the same layer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RUN apt-get update &amp;amp;&amp;amp; \
    apt-get install -y --no-install-recommends curl &amp;amp;&amp;amp; \
    rm -rf /var/lib/apt/lists/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Temporary files never persist. Cache efficiency and image size stay predictable. This is how production-grade engineers think about every layer: no surprises, minimal footprint.&lt;/p&gt;

&lt;h3&gt;
  
  
  10. Stale Base Images
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anti-pattern:&lt;/strong&gt; Set and forget.&lt;/p&gt;

&lt;p&gt;A base image untouched for months is a CVE time bomb. It doesn’t matter that the app works attacks don’t care either.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Scan + automate updates.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scan images in CI: &lt;code&gt;docker scout cves&lt;/code&gt; or Trivy&lt;/li&gt;
&lt;li&gt;Automate base bumps: Renovate, Dependabot, GitHub-native PRs&lt;/li&gt;
&lt;li&gt;Cadence: monthly (weekly if security-critical)&lt;/li&gt;
&lt;li&gt;Always test updates in staging before prod&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example Renovate snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "packageRules": [
    {
      "matchManagers": ["dockerfile"],
      "schedule": ["every weekend"]
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This combination keeps CVEs low with minimal manual effort.&lt;/p&gt;

&lt;p&gt;Impact&lt;/p&gt;

&lt;p&gt;Applied together, these 10 fixes typically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cut image size 70–90%&lt;/li&gt;
&lt;li&gt;Reduce CI build times 50–80%&lt;/li&gt;
&lt;li&gt;Lower vulnerability counts dramatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start with the worst offender run &lt;code&gt;docker scout cves&lt;/code&gt;or &lt;code&gt;trivy image&lt;/code&gt; today. Most changes are one-line or small-block diffs, but the operational payoff is massive.&lt;/p&gt;

&lt;p&gt;Most Docker problems aren’t Docker problems at all. They’re the result of copying a Dockerfile that worked once and never revisiting it. Treating container configuration as static, instead of something that evolves with your application and platform. I’ve been guilty of this too everyone has. We’re busy, and if it works, we move on.&lt;/p&gt;

&lt;p&gt;But small inefficiencies compound fast. That 4-minute build multiplies into hours per week. That bloated image racks up storage and transfer costs. That root user? A real security risk, not just a talking point in a blog.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s a pragmatic approach:&lt;/strong&gt; pick one fix from this list either the one that irritates you most or the one that’s easiest to implement, and do it this week. Then tackle another next week.&lt;/p&gt;

&lt;p&gt;You won’t transform your Docker setup overnight. But in a month, you’ll have smaller images, faster builds, and fewer 2 a.m. pages. That incremental improvement is worth every minute.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>containers</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Cobra CLI in Go</title>
      <dc:creator>Abdulmuhaimin1219</dc:creator>
      <pubDate>Fri, 05 Dec 2025 17:33:34 +0000</pubDate>
      <link>https://forem.com/abdulmuhaimin1219/cobra-cli-in-go-223i</link>
      <guid>https://forem.com/abdulmuhaimin1219/cobra-cli-in-go-223i</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Unlike Node.js, where a project already comes with the npm CLI and script handling via &lt;code&gt;package.json&lt;/code&gt;, Go projects don’t have a built‑in CLI for scripting. Instead, they rely on external adapters. Today I learned how to use &lt;strong&gt;Cobra CLI&lt;/strong&gt; to handle this, and I’ll walk you through the basics.&lt;/p&gt;




&lt;h2&gt;
  
  
  Installing Cobra CLI
&lt;/h2&gt;

&lt;p&gt;First, install Cobra CLI with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go get &lt;span class="nt"&gt;-u&lt;/span&gt; github.com/spf13/cobra@latest &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
go &lt;span class="nb"&gt;install &lt;/span&gt;github.com/spf13/cobra-cli@latest 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Initializing Your Project
&lt;/h2&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cobra-cli init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
This command generates a &lt;code&gt;main.go&lt;/code&gt; file and a &lt;code&gt;cmd&lt;/code&gt; folder containing a &lt;code&gt;root.go&lt;/code&gt; file. The &lt;code&gt;root.go&lt;/code&gt; file is where core CLI configurations are set up. You can also use this file for essential initialisations; for example, in my study case, I initialised the database connection within my project.&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating Your Own Command
&lt;/h2&gt;

&lt;p&gt;To create a new, custom command for your application, use the add command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cobra-cli add NAME-OF-COMMAND
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
If I use &lt;code&gt;cli&lt;/code&gt; as the name, Cobra generates a new file (e.g., &lt;code&gt;cli.go&lt;/code&gt;). This file includes basic description information that you can modify as needed.&lt;/p&gt;

&lt;p&gt;Defining Logic and Flags&lt;br&gt;
Inside the generated command file (e.g., &lt;code&gt;cli.go&lt;/code&gt;), I need to declare the variables that my function requires.&lt;/p&gt;

&lt;p&gt;In the generated &lt;code&gt;init&lt;/code&gt; function, I create the flags that my command can receive and associate each flag's value with a variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// Example of flag creation in the `init` function
func init() {
    // ... other code ...

    // Define flags and bind them to variables
    cliCmd.Flags().StringVarP(&amp;amp;action, "action", "a", "read", "Action to perform (create/read/update/delete)")
    cliCmd.Flags().StringVarP(&amp;amp;productName, "product", "p", "", "Name of the product")
    cliCmd.Flags().Float32VarP(&amp;amp;productPrice, "price", "r", 0.0, "Price of the product")
}

// Example of command execution in the Run function
func run(cmd *cobra.Command, args []string) {
    // Logic goes here
    fmt.Printf("Action: %s, Product: %s, Price: %.2f\n", action, productName, productPrice)
    // In a real app, this would call a function to interact with the database
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
Then, if I run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go run main.go cli -action=create -product=Produto -price=25.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
I am assigning values to the variables (action, productName, and productPrice), and the Run function can then use them to, for example, create a new product in the database.&lt;/p&gt;

</description>
      <category>go</category>
      <category>devops</category>
      <category>linux</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
