Docker basics
Installation guide
https://docs.docker.com/engine/install/ubuntu/
Steps to run and stop
create Dockerfile
touch Dockerfilenano Dockerfile# Use an official Node.js runtime as a parent image
FROM node:18
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install Node.js dependencies
RUN npm install
# Copy the rest of your application code to the container
COPY . .
# Expose the port your app will run on (e.g., 3000)
EXPOSE 3000
# Define the command to run your Node.js application
CMD ["node", "app.js"]
Build the Docker Image
Run the Docker Container
Stop the Docker Container
Remove the Docker Container
remove docker images
or
privesc with docker
ref:- https://book.hacktricks.xyz/linux-hardening/privilege-escalation/docker-security/docker-breakout-privilege-escalation#mounted-docker-socket-escape
Last updated