Skip to main content

Pull a PodArmor Image

We will use a NodeJS image as an example. You can find the full list images on our Images Repository.
docker pull parmor.azurecr.io/nodejs/nodejs:22
docker pull parmor.azurecr.io/nodejs-minimal/nodejs-minimal:22

Create a NodeJS container

1

Create a NodeJS application container

Create a new directory mkdir node-quickstart && cd node-quickstart and create a index.js file with the following content:
console.log('Hello, PodArmor!');
2

Create a Dockerfile

Create a Dockerfile with the following content:
FROM parmor.azurecr.io/nodejs/nodejs:22
COPY index.js /app/index.js
ENTRYPOINT ["node", "/app/index.js"]
3

Build the Docker image

Build the Docker image using the following command:
docker build -t node-quickstart .
4

Run the Docker container

Run the Docker container using the following command:
docker run node-quickstart

Create a minimal NodeJS deployment container

1

Create a package.json file with a random dependency

Create a new directory mkdir node-minimal && cd node-minimal and create a package.json file with the following content:
{
  "name": "node-minimal",
  "version": "1.0.0",
  "description": "A minimal Node.js application",
  "main": "minimal-index.js",
  "dependencies": {
    "random": "^5.1.1"
  },
  "type" : "module"
}
2

Create a minimal-index.js file

Create a minimal-index.js file with the following content:
import random from 'random';
console.log("Printing a random number:");
console.log(random.int(1, 100));
3

Create a Dockerfile.minimal

Create a Dockerfile.minimal with the following content:
FROM parmor.azurecr.io/nodejs/nodejs:22 AS build

COPY ./ /app
WORKDIR /app

RUN npm i --omit=dev

FROM parmor.azurecr.io/nodejs-minimal/nodejs-minimal:22
COPY --from=build /app /app

ENTRYPOINT ["node", "/app/minimal-index.js"]
4

Build the Docker image

Build the Docker image using the following command:
docker build -t node-minimal -f Dockerfile.minimal .
5

Run the Docker container

Run the Docker container using the following command:
docker run node-minimal