随笔分类 - Docker
摘要:Node.js on Containers So now what if we wanted to run a container that has Node.js in it? The default Ubuntu container doesn't have Node.js installed.
阅读全文
摘要:So it's much easier to do what we did with Docker. Run this command: docker run --interactive --tty alpine:3.19.1 # or, to be shorter: docker run -it
阅读全文
摘要:Go ahead and install the Remote - Containers extension. This takes everything one step further: you can actually set up someone's editor for them when
阅读全文
摘要:## Feed `env` to docker container In the code we need to use `const dataPath = path.join(process.env.DATA_PATH || "./data.txt");` When run docker cont
阅读全文
摘要:So far we've been dealing with self-contained containers. Normally this is all you ever want: containers that can spin up and spin down as frequently
阅读全文
摘要:## Basic node image ```Dockerfile FROM node:12-stretch COPY index.js index.js CMD ["node", "index.js"] ``` Build docker image: `docker build -t my-nod
阅读全文
摘要:So it's much easier to do what we did with Docker. Run this command: docker run --interactive --tty alpine:3.10 # or, to be shorter: docker run -it al
阅读全文
摘要:Okay, so now we've hidden the processes from Eve so Bob and Alice can engage in commerce in privacy and peace. So we're all good, right? They can no l
阅读全文
摘要:namespace While chroot is a pretty straightforward, namespaces and cgroups are a bit more nebulous to understand but no less important. Both of these
阅读全文
摘要:It's a Linux command that allows you to set the root directory of a new process. In our container use case, we just set the root directory to be where
阅读全文
摘要:For example you have two containers running Container A: need to talk to Container B Container B, running a node application export port 1337 From con
阅读全文
摘要:docker exec container-id sh -c "patch -p1 < your-file.diff" Replace container-id with the ID of the container you want to run the command in, and your
阅读全文
摘要:With a long-running node server and a database, sometimes it's useful to ssh into the virtual machine to explore the file system, and look at the data
阅读全文
摘要:To clean up Docker images and containers, you can use the following commands in the terminal: Remove all containers: docker rm $(docker ps -a -q) Remo
阅读全文
摘要:Existing Dockerfile Dockerfile: FROM python:3 ENV PYBASE /pybase ENV PYTHONUSERBASE $PYBASE ENV PATH $PYBASE/bin:$PATH RUN pip install pipenv WORKDIR
阅读全文
摘要:When we pass in "div" to document.querySelector, it returns an HTMLDivElement or null. Similarly, when we pass it "span" we're getting an HTMLSpanElem
阅读全文
摘要:### Create a docker file 1. Cd to the project: `cd widget-factory-inc/` 2. create a dockerfile: `vim dockerfile` ```bash FROM httpd:2.4 RUN apt update
阅读全文
摘要:Configuration and Installation Obtain the Azure login credentials: az login Copy the code provided by the command. Open a browser and navigate to http
阅读全文
摘要:Storing Container Data in AWS S3 Introduction Using Docker volumes is the preferred method of storing container data locally. Volume support is built
阅读全文
摘要:Introduction Docker volumes is the preferred method of storing container data locally. Volume support is built directly into Docker, making it an easy
阅读全文