docker-series | Docker Series about containerizing ASP | Continuous Deployment library
kandi X-RAY | docker-series Summary
kandi X-RAY | docker-series Summary
Docker Series about containerizing ASP.NET Core app with MySQL..
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of docker-series
docker-series Key Features
docker-series Examples and Code Snippets
Community Discussions
Trending Discussions on docker-series
QUESTION
I'm having a web application, which consists of two projects:
- using VueJS as a front-end part;
- using ExpressJS as a back-end part;
I now need to docker-size my application using a docker, but I'm not sure about the very first line in my docker files (which is referring to the used environment I guess, source).
What I will need to do now is separate docker images for both projects, but since I'm very new to this, I can't figure out what should be the very first lines for both of the Dockerfiles (in both of the projects).
I was developing the project in Windows 10 OS
, where I'm having node version v8.11.1
and expressjs version 4.16.3
.
I tried with some of the versions which I found (as node:8.11.1-alpine
) but what I got a warning: `
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host.
Which made me to think that I should not only care about node versions, instead to care about OS as well. So not sure which base images to use now.
...ANSWER
Answered 2018-Oct-02 at 08:07node:8.11.1-alpine
is a perfectly correct tag for a Node image. This particular one is based on Alpine Linux - a lightweight Linux distro, which is often used when building Docker images because of it's small footprint.
If you are not sure about which base image you should choose, just read the documentation at DockerHub. It lists all currently supported tags and describes different flavours of the Node image ('Image Variants' section).
Quote:
Image VariantsThe
node
images come in many flavors, each designed for a specific use case.node:
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. This tag is based off of
buildpack-deps
.buildpack-deps
is designed for the average user of docker who has many images on their system. It, by design, has a large number of extremely common Debian packages. This reduces the number of packages that images that derive from it need to install, thus reducing the overall size of all images on your system.node:-alpine
This image is based on the popular Alpine Linux project, available in the
alpine
official image. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use musl libc instead of glibc and friends, so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
To minimize image size, it's uncommon for additional related tools (such as
git
orbash
) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see thealpine
image description for examples of how to install packages if you are unfamiliar).node:-onbuild
The
ONBUILD
image variants are deprecated, and their usage is discouraged. For more details, see docker-library/official-images#2076.While the
onbuild
variant is really useful for "getting off the ground running" (zero to Dockerized in a short period of time), it's not recommended for long-term usage within a project due to the lack of control over when theONBUILD
triggers fire (see alsodocker/docker#5714
,docker/docker#8240
,docker/docker#11917
).Once you've got a handle on how your project functions within Docker, you'll probably want to adjust your
Dockerfile
to inherit from a non-onbuild
variant and copy the commands from theonbuild
variantDockerfile
(moving theONBUILD
lines to the end and removing theONBUILD
keywords) into your own file so that you have tighter control over them and more transparency for yourself and others looking at yourDockerfile
as to what it does. This also makes it easier to add additional requirements as time goes on (such as installing more packages before performing the previously-ONBUILD
steps).node:-slim
This image does not contain the common packages contained in the default tag and only contains the minimal packages needed to run
node
. Unless you are working in an environment where only thenode
image will be deployed and you have space constraints, we highly recommend using the default image of this repository.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install docker-series
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page