linuxmagazine, to linux
@linuxmagazine@fosstodon.org avatar
ramikrispin, to python
@ramikrispin@mstdn.social avatar

(1/4) ๐ˆ๐ง๐ญ๐ซ๐จ๐๐ฎ๐œ๐ญ๐ข๐จ๐ง ๐ญ๐จ ๐Œ๐ฎ๐ฅ๐ญ๐ข-๐’๐ญ๐š๐ ๐ž ๐ˆ๐ฆ๐š๐ ๐ž ๐๐ฎ๐ข๐ฅ๐ ๐Ÿณ ๐Ÿ๐จ๐ซ ๐๐ฒ๐ญ๐ก๐จ๐ง ๐Ÿ

The size of the Docker image could quickly increase during the build time. I became more mindful of the image size when I started to deploy on Github Actions. The bigger the image size, the longer the run time and the higher the runtime cost.

This is when you should consider using a multi-stage build ๐Ÿš€.

๐Ÿงต๐Ÿ‘‡๐Ÿผ

#docker #mlops #python #DataScience #medium

ramikrispin,
@ramikrispin@mstdn.social avatar

(3/4) ๐–๐ก๐ž๐ง ๐ฌ๐ก๐จ๐ฎ๐ฅ๐ ๐ฒ๐จ๐ฎ ๐ฎ๐ฌ๐ž ๐š ๐ฆ๐ฎ๐ฅ๐ญ๐ข-๐ฌ๐ญ๐š๐ ๐ž ๐›๐ฎ๐ข๐ฅ๐?
You should consider moving your build to a multi-stage build when the build-required dependencies are no longer needed after the build is completed. A classic example is when building a binary application. Also, this is effective when setting up a dockerized Python environment using a virtual environment.

#python #docker

ramikrispin,
@ramikrispin@mstdn.social avatar

(4/4) I created the following tutorial for setting up a dockerized Python environment using a multi-stage approach ๐Ÿ‘‡๐Ÿผ

https://medium.com/towards-data-science/introduction-to-multi-stage-image-build-for-python-41b94ebe8bb3

Happy Build! ๐Ÿณ๐Ÿ—๏ธ

#Docker #MLops #Python #DataScience #medium

stefano, to linux
@stefano@bsd.cafe avatar
underdarkGIS, (edited ) to random
@underdarkGIS@fosstodon.org avatar

Server โ€” edition

Today's post is a update. It's been a while (12 years ๐Ÿ˜ต) since I last posted about QGIS Server. It would be an understatement to say that things have evolved since then, not least due to the development of Docker which, Wikipedia tells me, was released 11 years ago. There have been multiple Docker images for QGIS Server provided by QGIS Community members over the years.

http://anitagraser.com/2024/04/20/qgis-server-docker-edition/

foxmask, to random French
@foxmask@framapiaf.org avatar

Yaurait pas une image docker pour installer #docker ? ๐Ÿ™ƒ

adminmagazine, to Kubernetes
@adminmagazine@hachyderm.io avatar

Are you looking to harness the power of containers? Learn more about Dockerโ€™s toolset for container development in our free focus guide available for a limited time. Download your copy today! https://mailchi.mp/admin-magazine.com/docker-focus-guide

Taffer, to bitwarden
@Taffer@mastodon.gamedev.place avatar

So there's an open source implementation of the BitWarden server software: https://github.com/dani-garcia/vaultwarden

I could self-host the family's password managerโ€ฆ probably don't want to do it on the home NAS. Maybe a tiny cloud server? I think it just needs Docker access, a port, and a little storage.

preya, to random
@preya@mastodon.social avatar

TIL: By default #Docker does not have log rotation or any size limit for log files on the host. I just found a 64GB logfile on a customer server.

underdarkGIS, to random
@underdarkGIS@fosstodon.org avatar

Today, I was again reminded that I'm not Apache admin enough to set it up correctly for #QGIS Server.

Luckily, there's a #Docker container to save the day: spin it up, put the project file in the data dir, and off you go with WMS, WFS, and wfs3 / OGC API

#GISChat

xavi, to Pixelfed
@xavi@social.arnaus.net avatar

I surrender for today. My :ladragonera:โ€‹ instance just works because the docker image is still in memory. My repository is messed up, the customisations are broken and the new docker-compose.yml and .env.docker` are completely failing to load, complaining about empty environment variables that have actual values.

I can't find documentation about how to migrate from v0.11.12 to v0.11.13 when using :docker:โ€‹ . I am disappointed.

To @dansup and the rest of Pixelfed developers: What you did here is a major change released by just bumping a patch version. That confuse instance maintainers. My instance is unexpectedly screwed up.

joe, to programming

We have talked about docker a few times in the past. Most recently, we talked about it in the context of running Ollama. For todayโ€™s post, I wanted to talk about how to turn your code into a docker container that you can run somewhere.

What is Docker

Docker provides the ability to package and run an application in a loosely isolated environment called a container. Docker containers can be deployed to just about any machine without any compatibility issues so your software stays system agnostic, making software simpler to use, less work to develop, and easier to maintain and deploy.

Once upon a time, a web application would be run on a physical piece of hardware that is running an operating system like Linux or Windows and then virtualization became a thing. Virtual machines access the hardware of a physical machine through a hypervisor. The host machine has an operating system (Ubuntu, Windows, MacOS, etc) and a hypervisor. Each virtual machine has an operating system of its own, binaries and libraries, and the actual web app. When using containers, the host machine has an operating system and a container engine but the containers only have binaries and libraries and the actual web app (no guest OS is necessary).

A dockerfile is needed to create an image and a container is the result of running an image. Today I am going to show how to go from a basic web app to a running docker container.

A Basic Node Example

If we are going to be dockerizing a web app, we need a web app to dockerize. In yesterdayโ€™s demo on how to pass an array as a property into a web component, we looked at three ways to turn an array into an unordered list. I figured that we could do the same with todayโ€™s demo.

In the above Node app, we are setting const items as being an array, using <a href="https://www.w3schools.com/nodejs/met_http_createserver.asp">createServer()</a> to create a new HTTP server, and then we are setting it to listen on port 8080. If you save the file locally as app.js, assuming that you have Node installed on your machine, you can run node app.js from the terminal to start the server.

https://i0.wp.com/jws.news/wp-content/uploads/2024/04/Screenshot-2024-04-15-at-12.09.13%E2%80%AFPM.png?resize=1024%2C764&ssl=1

Creating a Dockerfile

A Dockerfile isnโ€™t anything special. It is just a file called Dockerfile. For our test app, the Dockerfile only needs three things:

  1. A base image
  2. What to copy from the host machine and where to copy it to in the container
  3. The command that you want to run when the container launches

Our Dockerfile for this demo looks like this:

You will notice that it also includes the line EXPOSE 8080, to expose port 8080 but as you will see below, it is more for documentation purposes than anything else.

Creating a Dockerignore

If you are familiar with git, you likely know what a .gitignore file is. A .dockerignore file does something similar. A .dockerignore is a configuration file that describes files and directories that you want to exclude when building a Docker image. Usually, you put the Dockerfile in the root directory of your project, but there may be many files in the root directory that are not related to the Docker image or that you do not want to include. .dockerignore is used to specify unwanted files and not include them in the Docker image.

Building a Docker Image

Now that you have what you are dockerizing, a Dockerfile, and a .dockerignore, you can simply build by running docker build . in the terminal.

https://i0.wp.com/jws.news/wp-content/uploads/2024/04/Screenshot-2024-04-15-at-3.44.17%E2%80%AFPM.png?resize=1024%2C856&ssl=1

If you run docker images, you can see the result.

https://i0.wp.com/jws.news/wp-content/uploads/2024/04/Screenshot-2024-04-15-at-5.37.20%E2%80%AFPM.png?resize=1024%2C806&ssl=1

If you want to aid in maintainability a little, you can add -t [image name] to the build command. When you run docker build -t node-app . in the terminal, it looks like this โ€ฆ

https://i0.wp.com/jws.news/wp-content/uploads/2024/04/Screenshot-2024-04-15-at-8.10.32%E2%80%AFPM.png?resize=1024%2C806&ssl=1

โ€ฆ and when you rerun docker images, it now looks like โ€ฆ

https://i0.wp.com/jws.news/wp-content/uploads/2024/04/Screenshot-2024-04-15-at-8.13.57%E2%80%AFPM.png?resize=1024%2C806&ssl=1

Running your Docker Container

As I said above, an image becomes a container when you execute it. You can execute it by running docker run -d -p 8080:8080 6cced9894e8c where -d runs it as a daemon (a background process) and -p [port number]:[port number] tells the container what port to give it on the host machine. The 6cced9894e8c hash is the โ€œImage IDโ€ value from when I ran docker images above. If you tagged the image in the above step, you can use that value instead of the hash, though.

https://i0.wp.com/jws.news/wp-content/uploads/2024/04/Screenshot-2024-04-15-at-9.20.55%E2%80%AFPM.png?resize=1024%2C742&ssl=1

If you run docker ps after starting the container, you can verify that it is running. Go to http://localhost:8080/ and witness the splendor (now running in a docker container).

https://i0.wp.com/jws.news/wp-content/uploads/2024/04/Screenshot-2024-04-15-at-9.24.06%E2%80%AFPM.png?resize=1024%2C729&ssl=1

https://jws.news/2024/how-to-dockerize-a-node-app/

#Docker #NodeJs

jhx, to linux
@jhx@fosstodon.org avatar

In case anyone else ever has some fun with #docker and #libvirt / #kvm on #Linux :linux:

By default the FORWARD table drops all packages...
To get vm's back on the net simply leverage #iptables to make the packets flow again:

$ sudo iptables -A FORWARD -i br0 -o br0 -j ACCEPT

You can install iptables-persistent to save the current ruleset so it is applied every time you restart the system. ๐Ÿ˜‰

Did that on my #Debian workstation... I always fall for it. ๐Ÿ˜‚

ernie, to linux
@ernie@writing.exchange avatar

This oneโ€™s for the normies who just want Github to give them a goddamn exe file: The case for making self-hosted apps work more like, say, Flatpak.

https://tedium.co/2024/04/15/self-hosting-docker-flatpak/

new @tedium

#SelfHosting #linux #docker

potatomeow, to rust
@potatomeow@fosstodon.org avatar

what is a good based image for build my own container image for a #rustlang project? currently using docker.io/library/rust:slim-bookworm right now. my proj is running on rust nightly though. idk if it's gonna work.

currently waiting for the build to finish...
#docker #podman

graham_knapp, to django
@graham_knapp@hachyderm.io avatar

Why does an idle #django project (no api calls) running on #Docker compose on #wsl2 on #Windows constantly use 20% of my cpu?

BoydStephenSmithJr, to haskell
@BoydStephenSmithJr@hachyderm.io avatar

Anyone know if the images (e.g.: https://hub.docker.com/layers/fpco/stack-build/lts-22/images/sha256-09dcc6cf3739dbb5f73bbb84dc15ee815f463409653c5159673afc7d3b4134b7?context=explore) are still maintained, and what might be the best way to report a bug? :blobfoxconfused:

The LTS_SLUG seems wrong, and when I attempt a stack build in that image, I run out of space compiling GHC. (e.g.: https://gitlab.com/bss03/restman/-/jobs/6622698704) :blobfoxsurprised:

I expect the docker image would contain a GHC that stack would find and use; I am using the matching resolver for the tag (e.g.: 22.17). :blobfoxhappy:

leanpub, to devops
@leanpub@mastodon.social avatar

Network Automation Crash Course https://leanpub.com/b/networkautomationcrashcourse by GitforGits | Asian Publishing House is the featured bundle on the Leanpub homepage! https://leanpub.com

badnetmask, to Blog
@badnetmask@hachyderm.io avatar

New post! Check out this great app that automatically scans your Compose file, proxies all your services behind , and requests TLS certificates for all of them using a private CA (). The cherry on top is getting behind the proxy, and secure!

https://mteixeira.wordpress.com/2024/04/12/proxying-apps-behind-caddy-with-certs-from-private-ca-using-home-assistant-as-example/

alxd, to typescript
@alxd@writing.exchange avatar

Time for a post!

I'm looking for a / / 100% position, both contract and permanent, GMT+2 timezone.

I previously worked as a Senior / Lead / Principal developer with , and experience.

I specialize in , , , , , , , , and .

https://www.linkedin.com/in/paul-ngei/

danslerush, to linux
@danslerush@floss.social avatar

ยซ โ€™s Dedication to : A Robust Foundation for Developers ยป :debian:
โ€บ https://www.docker.com/blog/debian-for-docker-developers/

ampache, to random
@ampache@fosstodon.org avatar

The first #docker builds for #ampache 7 have been built!

Check out ampache/ampache:preview to see what's going on.

guerda, to homeassistant German
@guerda@ruhr.social avatar

I have an odd problem with #HomeAssistant in #Docker. In its docker container, the command wget does not resolve any domains. It just times out. Curl does resolve hosts correctly. Problem is: #HACS is using wget for updates, which then fail after a while (silently).

Other containers have a working wget, so it looks like it's homeassistant + docker in this case.

The container is (as documented) in host network mode.

Any ideas to fix this?

@homeassistant

  • All
  • Subscribed
  • Moderated
  • Favorites
  • โ€ข
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines