All posts by jackie

[0x17] Docker Intro Workshop Notes

Yesterday we had another instance of the Docker Intro workshop. Here are some notes on what we did.

You can find the slides for the workshop here: https://tantemalkah.at/2024/docker-intro

While the Docker Handbook by Farhan Hasin Chowdhury is great overall introduction to Docker, including setup and concept explanations, the Play with Docker classroom has many interactive tutorials, where you can neatly try out stuff on the side (right there in the browser, if you are logged in with a Docker Hub account – but you can do the same thing on your own machine, if you have Docker already running).

We specifically went through the Docker for Beginners – Linux lab, and here is a slightly adapted quick run-through version:

# clone the repo containing the demo app we'll run in a
# container later
git clone  https://github.com/dockersamples/linux_tweet_app
ls -l linux_tweet_app/

# check the hostname of a plain alpine linux container
docker run alpine hostname
# see all (also stopped) containers
# shortcut for: docker container ls --all
docker ps -a
# and now delete the unused alpine container
docker rm gifted_brown  # use the name from docker ps output

# run a bash (interactively) in a fresh ubuntu container
# (and remove it automagically after it stops)
docker run -it --rm ubuntu bash
# while the bash in the container is running you can check
# its status in another terminal
docker ps
# and after it is stopped it should be completely gone
docker ps -a

# run a MySQL container with a randomly generate root password
# (in detached mode, so it does not block your terminal)
docker run --rm --detach --name mysql \
  -e MYSQL_ROOT_PASSWORD=AZ2NchuaP149fmNRxqh1cmU0Mxg815Bg \
  mysql:latest
docker ps
# see the latest logs of the mysql container
docker logs mysql 
# output logs in "follow" mode (so log display keeps running)
# (if you want to quit the logs command again, type CTRL+C)
docker logs -f mysql
# see what processes are running in the mysql container
docker container top mysql 
# while the container is still running, execute another
# command in it, e.g. the mysql client to (the first "mysql"
# is the containter name, the second the actual "mysql"
# command, followed by its arguments) 
docker exec -it mysql mysql -u root -p -v
# in a separte terminal you can see that only one mysql
# container is running
docker ps

# now let's build an image for the demo app
cd linux_tweet_app/
cat Dockerfile 
docker image build --tag linux_tweet_app:1.0 .
docker images

# now we can run the demo app and map its port 80 to
# 1234 on the host
docker run -d -p 127.0.0.1:1234:80 \
  --name linux_tweet_app linux_tweet_app:1.0
docker ps
docker container stop linux_tweet_app 
docker rm linux_tweet_app

# now we run it with a mount, so we can change its html files
# directly from our host, without the need to go into the
# container and change it there
docker run --rm -d --publish 127.0.0.1:1234:80 \
  --name linux_tweet_app \
  --mount type=bind,source="$(pwd)",target=/usr/share/nginx/html \
  linux_tweet_app:1.0
docker ps
ls -l
# let's change something in the index.html file
# if you are not familiar with vim, you can also use nano or
# open the file in the file browser with your GUI editor
vim index.html
# now take a look at http://localhost:1234 to see the changes

# even if we stop (and implicitly remove) the container to
# start a fresh one, your changes are still persisted, 
# because they are now not saved in the container but in
# your mounted linux_tweet_app dir
docker stop linux_tweet_app 
docker run --rm -d --publish 127.0.0.1:1234:80 \
  --name linux_tweet_app \
  --mount type=bind,source="$(pwd)",target=/usr/share/nginx/html  \
  linux_tweet_app:1.0

One thing I want to mention here specifically is port mappings. In most tutorials and explanations, sometimes even in the official Docker docs, you will find port mappings like -p 1234:80, mapping the port 80 inside the container (where e.g. a web app is running) to the port 1234 on your host machine (so you can access it through http://localhost:1234). This is all fine, and maybe just the thing you want on the final production server (because somehow your visitors from the interwebs should be able to access the page inside the container – probably not on port 1234 though). But while developing and testing locally, you might have a security issue there. Because mapping -p 1234:80 means that the port 1234 is opened on ALL your interfaces. So whoever is on the same local network as you and has your IP address can also access your web app. But while developing or testing on your local machine, you might not have all required security measures in place. So the safer default is always to map it to your local port ONLY on your loopback interface (which is 127.0.0.1, the actual „localhost“). So instead of the above, use -p 127.0.0.1:1234:80. This way really only you (or anyone who already is on your machine) can access the web app inside the container.

In the end we also took a quick look at compose files and how they can be used to spin up a range of services. But as usual, time was way to short to get into everything in details. The general idea was that participants now have a good entrypoint (like every container needs), to continue exploring the Docker lands.

Here are also a few more resources to continue your journey (apart from the Docker Handbook and the Play with Docker classroom):

[0x17] Docker Intro Workshop on Aug. 10

Due to popular demand we are organising another installment of our recent Docker Intro Workshop, this time in a hybrid format so that people who cannot attend physically have an option to take part too. Also, to make it even more popular, we are teaming up with Women && Code and the Angewandte’s base dev team, who will co-host the workshop at the Angewandte (University of Applied Arts Vienna).

The workshop itself will be held in a hybrid format, so you can either attend in person or over Zoom. The Women && Code will host a summer party on site in the afternoon, which can be attended in person.

So, here the details and abouts:

Continue reading

[0x14-5] Double Feature: Clouds & Containers [notes]

On April 19 & 20, we (ad)ventured into the cloud & container lands. First, on Friday evening jackie gave hir talk titled Shine some light through this cloud. A short primer on clouds and cloud computing (the link leads to the slide deck), and in the following discussion we already talked a lot about the difference of full virtualisation and containerisation.

Then on Saturday afternoon we gathered again to go through a Docker Intro Workshop (link again leads to the slide deck of the workshop). In it we started by looking in to the basics of containerisation and how it works specifically with Docker.

Continue reading

[0x14-5] Double Feature: Clouds & Containers

In this edition we want to pair a talk about clouds and virtualisation with a Docker Intro Workshop. On a Friday evening jackie will give a talk to shine some light on this ominous „cloud“ thingy, and on the next day we want to take 4 hours for a Docker Intro Workshop in which participants learn to spin up their first docker containers and use docker compose to build some basic service ensembles.

While the talk on Friday is more like in the format of our usual meetups, and you can just show up, for the workshop on Saturday we need to limit the number of participants and therefore ask you to register. If you want to attend the workshop, please also come for the talk (and bring your device), as we will have time for some setup afterwards.

Continue reading

[0x13] Unsere Worte sind unsere Waffen

Und auch im März geht es gleich mit einem aufgezeichneten Talk aus dem WWW weiter, diesmal aus dem hochaktuellen Fundus der Aufzeichnungen vom letzten (dem 37.) Chaos Communication Congress:

Im Talk Unsere Worte sind unsere Waffen gibt uns Eva Wolfangel Einblicke darin, wie „wir Chatbots allein mit kreativer Wortfindung so manipulieren können, dass sie uns dienen (ja, social engineering funktioniert bei großen Sprachmodellen!)“

Die Raum-Zeit-Koordination für das Meetup:

  • am Fr, 22. März 2024 um 18 Uhr
  • im Gemeinschaftsraum Erdgeschoß
  • bei Hermann-Glück-Weg 6/4, 1120 Wien
  • Details zu Anfahrt, Raum und Umgebung unter (*2)

Der konkrete Zeitplan für das Meetup schaut dann so aus:

Continue reading

[0x12] Toward a New Hacker Ethic [notes]

Den vergangenen Freitag-Abend (16.2.) haben wir uns den Talk Programming is Forgetting: Toward a New Hacker Ethic von Allison Parrish angeschaut, den sie am Open Hardware Summit 2016 gehalten hat. Der Talk und ein Transkript davon sind unter dem Link nachschau- und lesbar.

Im Anschluss haben wir darüber diskutiert, inwiefern dieses Thema auch an unsere Diskussionen am 11. November beim Meetup [0x10] Ist Linux freie Software? anschließt, und was in welchen unserer eigenen Umfelder wir die von Allison Parrish angesprochenen Aspekte auch als besonders aktuell und wichtig erachten. Ganz kurzes und vorsichtiges Fazit: es braucht auf jeden Fall noch mehr solcher Talks und viel Awarenessarbeit um viele Hacking- und Freie Software-Kontexte solidarisch und emanzipatorsich zu gestalten, und nicht als Selbstversorgungs- oder -beschäftigungsprojekt einer kleinen relativ privilegierten Gruppe in unserer Gesellschaft.

Insgesamt fanden wir das Format „Talk schauen und diskutieren“ sehr angenehm, weshalb wir das gleich nochmal für den 22. März eingeplant haben – der konkrete Talk steht aber noch nicht fest. Eine Ankündigung folgt bis Anfang März. Außerdem haben wir für 19./20. April das Nachholen des Docker-Workshops eingeplant, der ursprünglich schon im Juni 2022 stattfinden hätte sollen. Auch hier wird es demnächst eine Ankündigung geben.

[0x12] Toward a New Hacker Ethic

Ursprünglich im Jänner geplant, findet unser nächstes offizielles Meetup nun im Feber statt, und zwar:

  • am Fr, 16. Feb. 2024 um 18 Uhr
  • im Gemeinschaftsraum Erdgeschoß
  • bei Hermann-Glück-Weg 6/4, 1120 Wien
  • Details zu Anfahrt, Raum und Umgebung unter (*2)

Diesmal wollen wir uns gemeinsam den Talk Programming is Forgetting: Toward a New Hacker Ethic von Allison Parrish anschauen und diskutieren. Der konkrete Zeitplan für das Meetup schaut dann so aus:

Continue reading

[0x11] Gemeinsam Code-Puzzlen am 3.12.2023

Das kommende Meeting wird remote auf unserem Discord-Server stattfinden und ist ein eher lose strukturierter Hangout um gemeinsam Code-Puzzles zu lösen. Und zwar wollen wir, wie in den letzten Jahren auch, die ersten drei Beispiele des Advent of Code lösen und unsere Lösungsvarianten besprechen. Diese liegen dann üblicherweise auch in unterschiedlichen Sprachen vor, je nachdem womit die Teilnehmer:innen eben gerade arbeiten wollen. Es gab in den letzten Jahren auch Varianten in bash, um hier ein bisschen expliziteren Linux-Bezug herzustellen.

Continue reading