Skip to content
Artwork for Runtime Arguments
Runtime Arguments · March 7 · 1 hr 41 min

23: Containers - What's in the box????

Containers have become the standard way for deploying applications on servers and the web and sometimes even on the desktop. In this episode we dive into what containers are, how they work, how to build them and what you can do with them. Whether you are using containers in your development environment, deploying on servers in your data center or as a cloud service, containers save time, handle dependencies, increase security and just make things easier and better in so many ways. We discuss several commands to build and run containers and we've included examples here: Dockerfile example: ------------------------------------------------------------------------------------------------------- FROM ubuntu RUN apt update && apt install -y apache2 ENTRYPOINT [ "/usr/sbin/apachectl", "-D", "FOREGROUND", "-k", "start" ] ------------------------------------------------------------------------------------------------------- Build the image using the above Dockerfile: docker buildx build --tag my_container ./ Run the container: docker run -p 8080:80 -d my_container Now, point your web browser at http://localhost:8080 (assuming you did this on your desktop) Display a list of running containers: docker compose ls Attach to a running container and get a shell: docker exec -it [container name] /bin/bash Stop a container: docker container stop [container name] Start it running again: docker container start [container name] Remove a container (after stopping it) docker container rm [container name] Hosts: Jim McQuillan can be reached at jam@RuntimeArguments.fm Wolf can be reached at wolf@RuntimeArguments.fm Follow us on Mastodon: @RuntimeArguments@hachyderm.io If you have feedback for us, please send it to feedback@RuntimeArguments.fm Checkout our webpage at http://RuntimeArguments.fm Theme music: Dawn by nuer self, from the album Digital Sky

0:00-1:41:00

transcript

No transcript — this publisher did not publish one.

show notes

Containers have become the standard way for deploying applications on servers and the web and sometimes even on the desktop.

In this episode we dive into what containers are, how they work, how to build them and what you can do with them.

Whether you are using containers in your development environment, deploying on servers in your data center or as a cloud service, containers save time, handle dependencies, increase security and just make things easier and better in so many ways.

We discuss several commands to build and run containers and we've included examples here:

Dockerfile example:

-------------------------------------------------------------------------------------------------------

FROM ubuntu

RUN apt update && apt install -y apache2

ENTRYPOINT [ "/usr/sbin/apachectl", "-D", "FOREGROUND", "-k", "start" ]

-------------------------------------------------------------------------------------------------------

Build the image using the above Dockerfile:

    docker buildx build --tag my_container ./

Run the container:

    docker run -p 8080:80 -d my_container

Now, point your web browser at http://localhost:8080 (assuming you did this on your desktop)

Display a list of running containers:

    docker compose ls

Attach to a running container and get a shell:

    docker exec -it [container name] /bin/bash

Stop a container:

    docker container stop [container name]

Start it running again:

    docker container start [container name]

Remove a container (after stopping it)

    docker container rm [container name]


Hosts:
Jim McQuillan can be reached at jam@RuntimeArguments.fm
Wolf can be reached at wolf@RuntimeArguments.fm

Follow us on Mastodon: @RuntimeArguments@hachyderm.io

If you have feedback for us, please send it to feedback@RuntimeArguments.fm

Checkout our webpage at http://RuntimeArguments.fm

Theme music:
Dawn by nuer self, from the album Digital Sky

links1