Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

docker build

docker build -t [tag] .
Comment

docker build

docker build -t myName:myTag -f myDockerfile .
Comment

docker build

docker build -t imageName:imageTag pathToDockerfileDirectory/

Example:
docker build -t vieux/apache:2.0 .
Comment

docker build -t

--tag , -t   ---->   Name and optionally a tag in the ‘name:tag’ format
Comment

docker BUILD commands

services:
  web:
    dns: 8.8.8.8
    dns:
      - 8.8.8.8
      - 8.8.4.4
Comment

docker BUILD commands

docker kill $(docekr ps -q )
Comment

docker BUILD commands

docker stack rm stack_name
Comment

docker BUILD commands

docker swarm leave
Comment

docker BUILD commands

docker service scale stack_name_service_name=replicas
Comment

docker BUILD commands

docker service logs stack_name service_name
Comment

docker BUILD commands

docker stack services stack_name
Comment

docker BUILD commands

docker service ls
Comment

docker BUILD commands

services:
  web:
    extra_hosts:
      - "somehost:192.168.1.100"
Comment

docker BUILD commands

services:
  web:
    external_links:
      - redis_1
      - project_db_1:mysql
Comment

docker BUILD commands

services:
  web:
    devices:
    - "/dev/ttyUSB0:/dev/ttyUSB0"
Comment

docker BUILD commands

# make this service extend another
  extends:
    file: common.yml  # optional
    service: webapp
Comment

docker BUILD commands

services:
  web:
    labels:
      com.example.description: "Accounting web app"
Comment

docker BUILD commands

volumes:
    - /var/lib/mysql
    - ./_data:/var/lib/mysql
Comment

docker BUILD commands

# make sure `db` is alive before starting
  depends_on:
    - db
Comment

docker BUILD commands

# makes the `db` service available as the hostname `database`
  # (implies depends_on)
  links:
    - db:database
    - redis
Comment

docker BUILD commands

# environment vars from file
  env_file: .env
  env_file: [.env, .development.env]
Comment

docker BUILD commands

# environment vars
  environment:
    RACK_ENV: development
  environment:
    - RACK_ENV=development
Comment

docker BUILD commands

# override the entrypoint
  entrypoint: /app/start.sh
  entrypoint: [php, -d, vendor/bin/phpunit]
Comment

docker BUILD commands

# command to execute
  command: bundle exec thin -p 3000
  command: [bundle, exec, thin, -p, 3000]
Comment

docker BUILD commands

# expose ports to linked services (not to host)
  expose: ["3000"]
Comment

docker BUILD commands

# build from image
  image: ubuntu
  image: ubuntu:14.04
  image: tutum/influxdb
  image: example-registry:4000/postgresql
  image: a4bc65fd
Comment

docker BUILD commands

# build from custom Dockerfile
  build:
    context: ./dir
    dockerfile: Dockerfile.dev
Comment

docker BUILD commands

web:
  # build from Dockerfile
  build: .
Comment

docker build command

docker-compose build
Comment

PREVIOUS NEXT
Code Example
Shell :: how to setup vim plugins 
Shell :: raspberry pi install vscode via command line 
Shell :: remove folder with content cmd 
Shell :: how to remove amplify from system globally 
Shell :: gen_random_uuid() does not exist 
Shell :: check gcc version in ubuntu 
Shell :: download nodejs debian linux 
Shell :: install latex 
Shell :: command to stop a system service 
Shell :: change remote origin git 
Shell :: git pull from template repository 
Shell :: github git init main 
Shell :: lock symbol on files in ubuntu 
Shell :: docker run always puull 
Shell :: install oh my zsh! 
Shell :: unix terminal search inside file 
Shell :: git change message specific commit 
Shell :: unix get epoch in miliseconds shell 
Shell :: list inactive services ubuntu 
Shell :: mac Running setup.py install for pyodbc did not run successfully. 
Shell :: git branch -r 
Shell :: git delete local branch 
Shell :: surge delete project 
Shell :: could not open lock file "/tmp/.s.PGSQL.5432.lock": Permission denied 
Shell :: ubuntu check available packages 
Shell :: copy files between servers 
Shell :: installer microsoft teams ubuntu 
Shell :: batch color escape character 
Shell :: how to get out of branch git 
Shell :: clone with ssh gitlab fatal: Could not read from remote repository. 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =