Sangmun

알파인 리눅스(Alpine linux) 본문

개발

알파인 리눅스(Alpine linux)

상상2 2022. 8. 27. 21:21

회사에서 솔루션 연동건으로 알아보다가 알게된 OS다.

사실 꽤 오래전부터 유명했던거 같은데 이제 알게되서 뭔가 부끄럽다.

 

https://wiki.alpinelinux.org/wiki/Alpine_Linux:Overview

 

Alpine Linux:Overview - Alpine Linux

Alpine uses musl as its libc, and BusyBox as core utilities. These choices tend to make Alpine especially minimalist and secure. General overview Alpine Linux has one of the fastest boot times of any operating system. Famous because of its small size, it's

wiki.alpinelinux.org

알파인 리눅스는 위키 형태로 document가 있고 꽤 잘 설명되어있는것 같다.

 

알파일 리눅스의 장점은 뭐니뭐니 해도 가벼운 용량이다. 이때문에 도커 환경에서 자주 사용된다.

 

centos, ubuntu와 비교했을때 어마어마한 차이가난다..

 

아무튼 내임무는 alpine linux + apache tomcat의 환경에서 보안 관련 솔루션을 연동하는건인데.

 

그래서 해당 환경을 구성할 수 있는 Dockerfile을 구성해 보았다.

 

# 참고자료

 

1. docker hub alpine linux official Image

https://hub.docker.com/_/alpine

 

alpine - Official Image | Docker Hub

About Official Images Docker Official Images are a curated set of Docker open source and drop-in solution repositories. Why Official Images? These images have clear documentation, promote best practices, and are designed for the most common use cases.

hub.docker.com

2. alpine 환경에서 tomcat 설치 및 실행

https://wiki.alpinelinux.org/wiki/Tomcat

 

Tomcat - Alpine Linux

Apache Tomcat is an open source web server that implements the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. It can also serve static HTML pages. This How-To describes how to set-up Tomcat to deliver static HTML

wiki.alpinelinux.org

3. Dockerfile

FROM alpine:3.16

# Java install
RUN apk add openjdk8-jre-base
RUN java -version
RUN mkdir /opt/tomcat

# tomcat install
COPY apache-tomcat-9.0.44.tar.gz .
RUN tar xvzf apache-tomcat-9.0.44.tar.gz --strip-components 1 --directory /opt/tomcat

# 여기에서 이제 타사 솔루션 파일을 복사...
COPY ... .

ENTRYPOINT ["/opt/tomcat/bin/catalina.sh","run"]

4. 폐쇄망으로 구성된 도커 이미지 옮기기 (빌드를 외부에서 하고 이미지 이동 후 폐쇄망에서 이미지 실행)

https://stackoverflow.com/questions/48125169/how-run-docker-images-without-connect-to-internet

 

How run docker images without connect to Internet?

I have installed docker in a system which has no connection to Internet so to run an image with docker, I had to download a simple image from this and from another system. Then I put this image in my

stackoverflow.com

간단한 명령어로 이미지를 옮길 수 있는 기능이 있다는건 오늘 처음 알았다.

 

이제 솔루션을 연동해보자....

'개발' 카테고리의 다른 글

저작권에 대한 내용 정리  (0) 2023.01.23
자연어 전처리 관련 유용한 패키지  (0) 2023.01.22
python 코드 formatter black  (0) 2023.01.06
python flake8 기본 사용법  (0) 2023.01.05
Mini conda  (0) 2022.10.20
Comments