Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

docker best practices


# read more: https://testdriven.io/blog/docker-best-practices/
#This will mount the secret from the secrets.txt file.
docker build --no-cache --progress=plain --secret id=mysecret,src=secrets.txt .



#### Dockerfile:

# temp stage
FROM python:3.9-slim as builder

WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN apt-get update && 
    apt-get install -y --no-install-recommends gcc

RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

COPY requirements.txt .
RUN pip install -r requirements.txt


# final stage
FROM python:3.9-slim

COPY --from=builder /opt/venv /opt/venv

WORKDIR /app

ENV PATH="/opt/venv/bin:$PATH"
Comment

PREVIOUS NEXT
Code Example
Shell :: docker input device is not a tty 
Shell :: /zsh-autosuggestions/zsh-autosuggestions.zsh^M 
Shell :: sh: webpack-dev-server: command not found 
Shell :: move to folder in command line windows 
Shell :: how to set environment variables in linux 
Shell :: bash escape all special characters 
Shell :: how to create a text file list of the contents of a folder and subfolders 
Shell :: dracula theme gnome terminal 
Shell :: jq command in linux 
Shell :: hugo documentation 
Shell :: check my current branch git 
Shell :: make atom default editor in git 
Shell :: docker repository 
Shell :: bash delete a command line 
Shell :: instaling ansible on ubuntu linux 
Shell :: printf linux 
Shell :: npm install firebase @angular/fire 
Shell :: git add . 
Shell :: Installing Dradis 
Shell :: linux shutdown no password 
Shell :: exception in linux 
Shell :: git remove repo from folder 
Shell :: how to see running commands linux 
Shell :: ubuntu list compillers 
Shell :: view git branch changes graphically 
Shell :: delete all view options mac os 
Shell :: how to install random module in python 
Shell :: webpack for old browser 
Shell :: bnmbmbmmbjhgnbhgmv nbhgmvnb 
Shell :: tablet mode powershell script 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =