Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

655
Views
Installing netstat on docker linux container

I want to install netstat on my Docker container.

I looked here https://askubuntu.com/questions/813579/netstat-or-alternative-in-docker-ubuntu-server-16-04-container so I'm trying to install it like this:

apt-get install net-tools

However, I'm getting:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package net-tools

So how can I install netstat?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You need to run apt-get update first to download the current state of the package repositories. Docker images do not include this to save space, and because they'd likely be outdated when you use it. If you are doing this in a Dockerfile, make sure to keep it as a single RUN command so that caching of the layers doesn't cache an old version of the update command with a new package install request:

RUN apt-get update \
  && DEBIAN_FRONTEND=noninteractive apt-get install -y \
    net-tools \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*
over 4 years ago · Santiago Trujillo Report

0

netstat is provided by the net-tools package,net-tools is probably not installed by default in the Docker image for Ubuntu 16.04 to keep the image size as small as possible. Execute the following commands inside docker container:

apt update
apt install net-tools
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!