Giter Site home page Giter Site logo

docker_template's Introduction

docker_template

template for docker container

Installation

  • OSX Just install docker for max.
  • Windows Install docker for windows
  • linux

How to use?

Put .devcontainer folder into your projects.

Without remote container

  • go to .devcontainer folder and run docker-compose up -d
  • docker container ls -a to check the list container. You may see an image with running status.
  • docker exec -it <project_name> bash to run bash terminal inside the docker container.

With remote container

  • Install remote container extension in vscode.

  • go to command palette or press F1 and choose Reopen in container .. command.

  • For the first time, you need to build image and compose a container.

  • If you want to rebuild, run Rebuild .. in command palette.

  • compose.yml

    • In order to use github, you need to check .ssh folder is under home directory (~) in host machine.
      • This enable using the private keys without copying
  • dockerfile

    • It uses mcr.microsoft.com/vscode/devcontainers that best suit for remote container.
      • If you pick mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04, there is no differece between ubuntu:22.04 which is the official image.
      • Dockerfile_base uses base ubuntu image.
    • This image have user called vscode. If you wanto change user name, then change ARG USERNAME=<name> in dockerfile or USERNAME:<name> in docker-compose.yml
  • About permissions

    • OSX

      • Some error message when trying to save in vscode? No solution yet. Maybe because of autosave.

        • you need to turn-off the autosave.
    • Windows

  • Libraries

    • extundelete can restore deleted files by rm -rf. sudo apt-get install extundelete
  • Build multi-architecture with buildx

    • Create builder

      • docker buildx create --name mybuilder --driver docker-container --bootstrap
      • docker buildx use mybuilder
      • docker buildx inspect to check inside.
    • Build multi-arch image

      • docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t /:latest --push . -f e.g. docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t kei0709/ubuntu22.04_nodejs:v3.0 --push . -f ubuntu22.04_nodejs.dockerfile

versions

  • v1.0

    • The use of bind mount makes it so that any changes made within the Docker container are reflected on the host machine.
    • However, there is a potential for this setup to negatively impact performance.
  • v2.0

    • We've switched to using volume mount instead.
    • This means that any changes made within the container will be stored in a separate folder from the host machine, so if you want work in docker container, you'll need to copy or move the folder.
    • Performance (mainly I/O) increased.
    • bug fixed
      • ssh_find_agent is fixed.
  • v3.0

    • since poor performance (read and write b/w HD) only yeild on M1 mac, it's not necessary to use v2.0 on normal PC
    • for max os higher than 12.5, one can use Virtiofs and it solve performance problem on bind volume.
    • So, v3.0 is basically same as v1.0
    • But Virtiofs is still unstable so be careful to use.

docker_template's People

Contributors

mkrbm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.