Skip to content

Commit

Permalink
Add support for compose CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
schnatterer committed May 27, 2021
1 parent e4a37d3 commit 7c9fbc1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ ARG DOCKER_VERSION=20.10.6
ARG DOCKER_BUILDX_VERSION=0.5.1
ARG DOCKER_APP_VERSION=0.9.1-beta3
ARG DOCKER_SCAN_VERSION=0.8.0
ARG COMPOSE_CLI_VERSION=1.0.16

RUN mkdir -p /dist/usr/bin
RUN mkdir -p /dist/home/node/.docker/cli-plugins
RUN mkdir /dist/app

WORKDIR /work

# Install docker CLI
RUN mkdir -p /dist/usr/bin
RUN wget -qc -O docker.tgz "https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz"
RUN tar -xzf docker.tgz
RUN mv docker/docker /dist/usr/bin/
Expand All @@ -28,11 +29,19 @@ RUN tar xzf docker-app-linux.tar.gz
RUN mv docker-app-plugin-linux /dist/home/node/.docker/cli-plugins/docker-app

# Install "docker scan" plugin
#RUN wget https://github.com/docker/scan-cli-plugin/releases/download/latest/docker-scan_linux_amd64
RUN wget https://github.com/docker/scan-cli-plugin/releases/download/v${DOCKER_SCAN_VERSION}/docker-scan_linux_amd64
RUN chmod +x docker-scan_linux_amd64
RUN mv docker-scan_linux_amd64 /dist/home/node/.docker/cli-plugins/docker-scan

# Install compose
RUN wget https://github.com/docker/compose-cli/releases/download/v${COMPOSE_CLI_VERSION}/docker-linux-amd64.tar.gz
RUN tar xzf docker-linux-amd64.tar.gz
RUN mkdir -p /dist/usr/local/bin
RUN install -m 775 docker/docker /dist/usr/local/bin/docker
RUN ln -s /usr/bin/docker /dist/usr/local/bin/com.docker.cli
RUN mv docker/docker-compose /dist/home/node/.docker/cli-plugins/docker-compose


COPY package.json .
COPY yarn.lock .
RUN yarn install
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ drrmitep sh image # docker run --rm -it --entrypoint sh image
drrmep id image # docker run --rm --entrypoint id image
dexit container sh # docker exec -it container sh
drmf container # docker rm -f container

#See https://github.com/docker/compose-cli/blob/main/INSTALL.md
dco # docker compose
dcoup # docker compose up
dcoupd # docker compose up -d
dcob # docker compose build
dcod # docker compose down
dcodv # docker compose down -v
dcolg # docker compose logs
dcolg # docker compose logs
dcol # docker compose pull
dcoex service command # docker compose logs service command
dcof file up # docker compose -f file up
```

### Parameters in aliases
Expand Down
7 changes: 4 additions & 3 deletions createAliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ let predefinedAbbrevCmds = {
br: 'builder',
bx: 'buildx',
c: 'container',
cm: 'commit',
cf: 'config',
cm: 'commit',
co: 'compose',
cx: 'context',
ex: 'exec',
img: 'image',
Expand All @@ -49,10 +50,10 @@ let predefinedAbbrevCmds = {
r: 'run',
s: 'swarm',
se: 'search',
svc: 'service',
st: 'stack',
t: 'tag',
sta: 'start',
svc: 'service',
t: 'tag',
};
const predefinedAbbrevCmdsByCommand = swapKeyValue(predefinedAbbrevCmds);

Expand Down

0 comments on commit 7c9fbc1

Please sign in to comment.